Skip to content

Commit

Permalink
moving up test case
Browse files Browse the repository at this point in the history
  • Loading branch information
gulien committed Apr 23, 2018
1 parent 1997756 commit 4c192f9
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions app/generator/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,11 @@ func TestExecute(t *testing.T) {
if _, err := g.Execute(); err != nil {
t.Errorf("OrbitGenerator should have been able to parse the data-driven template %s", templateFilePath)
}
}

func TestExecuteMissingVariableError(t *testing.T) {
dataSourceFilePath, _ := filepath.Abs("../../_tests/data-source.yml")

// case 1: uses a broken data-driven template.
brokenTemplateFilePath, _ := filepath.Abs("../../_tests/broken-template-missing-var.yml")
ctx, _ := context.NewOrbitContext(brokenTemplateFilePath, "Values,"+dataSourceFilePath)
g := NewOrbitGenerator(ctx)
// case 3: uses a broken data-driven template with a missing variable.
brokenTemplateFilePath, _ = filepath.Abs("../../_tests/broken-template-missing-var.yml")
ctx, _ = context.NewOrbitContext(brokenTemplateFilePath, "Values,"+dataSourceFilePath)
g = NewOrbitGenerator(ctx)
if _, err := g.Execute(); err == nil {
t.Errorf("OrbitGenerator should not have been able to render the data-driven template %s", brokenTemplateFilePath)
}
Expand Down

0 comments on commit 4c192f9

Please sign in to comment.