Пример #1
0
 @Test
 public void exceptionIsThrownIfBladeNameIsInvalid() throws Exception {
   given(bladeset)
       .hasBeenCreated()
       .and(defaultTemplates)
       .templateGroupCreated()
       .and(logging)
       .enabled();
   when(brjs).runCommand("create-blade", "app", "bladeset", "!$%$^");
   then(logging)
       .errorMessageReceived(NODE_CREATION_FAILED_LOG_MSG, "Blade", badBlade.dir().getPath())
       .and(exceptions)
       .verifyException(InvalidDirectoryNameException.class, "!$%$^", badBlade.dir().getPath())
       .whereTopLevelExceptionIs(CommandArgumentsException.class)
       .and(logging)
       .otherMessagesIgnored();
 }
Пример #2
0
 @Test
 public void exceptionIsThrownIfTheBladeAlreadyExists() throws Exception {
   given(blade).hasBeenCreated();
   when(brjs).runCommand("create-blade", "app", "bladeset", "blade");
   then(exceptions)
       .verifyException(
           NodeAlreadyExistsException.class, "blade", unquoted(blade.getClass().getSimpleName()))
       .whereTopLevelExceptionIs(CommandArgumentsException.class)
       .and(logging)
       .otherMessagesIgnored();
 }
Пример #3
0
 @Test
 public void bladeIsCreatedWhenAllArgumentsAreValid() throws Exception {
   given(bladeset).hasBeenCreated().and(defaultTemplates).templateGroupCreated();
   when(brjs).runCommand("create-blade", "app", "bladeset", "blade");
   then(blade)
       .dirExists()
       .and(logging)
       .containsFormattedConsoleMessage(BLADE_CREATE_SUCCESS_CONSOLE_MSG, "blade")
       .and(logging)
       .containsFormattedConsoleMessage(BLADE_PATH_CONSOLE_MSG, blade.dir().getPath());
 }
Пример #4
0
 @Test
 public void bladeIsCreatedInTheDefaultBladesetIfBladesetNotSpecified() throws Exception {
   given(bladeset).hasBeenCreated().and(defaultTemplates).templateGroupCreated();
   when(brjs).runCommand("create-blade", "app", "default", "blade1");
   then(blade1InDefaultBladeset)
       .dirExists()
       .and(logging)
       .containsFormattedConsoleMessage(BLADE_CREATE_SUCCESS_CONSOLE_MSG, "blade1")
       .and(logging)
       .containsFormattedConsoleMessage(
           BLADE_PATH_CONSOLE_MSG, blade1InDefaultBladeset.dir().getPath());
 }
Пример #5
0
 public void emptyFolderIsCreatedIfTemplateForImplicitlyPopulatedTemplateDoesNotExist()
     throws Exception {
   given(bladeset).hasBeenCreated().and(angularTemplates).templateGroupCreated();
   when(brjs).runCommand("create-app", "app", "--template", "angular");
   then(blade).hasDir("test-unit").and(blade.file("test-unit")).isEmpty();
 }