Ejemplo n.º 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();
 }
Ejemplo n.º 2
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());
 }
Ejemplo n.º 3
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());
 }