Exemplo n.º 1
0
 @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");
 }
Exemplo n.º 2
0
 @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");
 }
Exemplo n.º 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;
 }