@@ -34,23 +34,30 @@ public void init() {
34
34
}
35
35
36
36
@ Test
37
- public void missingTemplate () {
37
+ public void usesDefaultTemplate () {
38
38
IntegUtils .withProject (PROJECT_NAME , templatesDir -> {
39
39
setupTemplatesDirectory (templatesDir );
40
40
41
- IntegUtils .withTempDir ("missingTemplate " , dir -> {
41
+ IntegUtils .withTempDir ("defaultTemplate " , dir -> {
42
42
RunResult result = IntegUtils .run (
43
- dir , ListUtils .of ("init" , "-u" , templatesDir .toString ()));
43
+ dir , ListUtils .of ("init" , "-u" , templatesDir .toString ()));
44
44
assertThat (result .getOutput (),
45
- containsString ("Please specify a template using `--template` or `-t` " ));
46
- assertThat (result .getExitCode (), is (1 ));
45
+ containsString ("Smithy project created in directory: quickstart-cli " ));
46
+ assertThat (result .getExitCode (), is (0 ));
47
47
});
48
+ });
49
+ }
50
+
51
+ @ Test
52
+ public void missingTemplate () {
53
+ IntegUtils .withProject (PROJECT_NAME , templatesDir -> {
54
+ setupTemplatesDirectory (templatesDir );
48
55
49
56
IntegUtils .withTempDir ("emptyTemplateName" , dir -> {
50
57
RunResult result = IntegUtils .run (
51
58
dir , ListUtils .of ("init" , "-t" , "" , "-u" , templatesDir .toString ()));
52
59
assertThat (result .getOutput (),
53
- containsString ("Please specify a template using `--template` or `-t`" ));
60
+ containsString ("Please specify a template name using `--template` or `-t`" ));
54
61
assertThat (result .getExitCode (), is (1 ));
55
62
});
56
63
});
0 commit comments