@Test
 public void defaultTemplateIsUsedIfNoneSpecifiedAndMultipleTemplatesExist() throws Exception {
   given(bladeset)
       .hasBeenCreated()
       .and(angularTemplates)
       .templateGroupCreated()
       .and(angularTemplates.template("blade"))
       .containsFile("fileForBladeAngular.txt")
       .and(defaultTemplates)
       .templateGroupCreated()
       .and(defaultTemplates.template("blade"))
       .containsFile("fileForBladeDefault.txt")
       .and(myTemplateTemplates)
       .templateGroupCreated()
       .and(myTemplateTemplates.template("blade"))
       .containsFile("fileForBladeMyTemplate.txt");
   when(brjs).runCommand("create-blade", "app", "default", "blade1");
   then(blade1InDefaultBladeset)
       .dirExists()
       .and(blade1InDefaultBladeset)
       .hasFile("fileForBladeDefault.txt");
 }
 @Test
 public void bladeIsCreatedWithTheSpecifiedTemplateShortFlag() throws Exception {
   given(bladeset)
       .hasBeenCreated()
       .and(angularTemplates)
       .templateGroupCreated()
       .and(angularTemplates.template("blade"))
       .containsFile("fileForBlade.txt");
   when(brjs).runCommand("create-blade", "app", "default", "blade1", "-T", "angular");
   then(blade1InDefaultBladeset)
       .dirExists()
       .and(blade1InDefaultBladeset)
       .hasFile("fileForBlade.txt");
 }
Exemple #3
0
 public BuilderChainer templateGroupCreated() throws InvalidNameException, ModelUpdateException {
   templateGroup.template("app").create();
   templateGroup.template("aspect").create();
   templateGroup.template("bladeset").create();
   templateGroup.template("blade").create();
   templateGroup.template("br-lib").create();
   templateGroup.template("thirdparty-lib").create();
   return builderChainer;
 }