Skip to content

Commit

Permalink
Nest and parallelise tests
Browse files Browse the repository at this point in the history
[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
  • Loading branch information
jchester authored and jchesterpivotal committed Aug 18, 2018
1 parent fb7b35a commit df7abc6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/build-pass-fail/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestBuildPassFail(t *testing.T) {
gt.Eventually(session.Err).Should(gbytes.Say("could not parse build/build.json"))
})
})
})
}, spec.Nested())

when("a path to a json file is given", func() {
it.Before(func() {
Expand All @@ -75,7 +75,7 @@ func TestBuildPassFail(t *testing.T) {
it("opens and attempts to parse the file", func() {
gt.Eventually(session.Err).Should(gbytes.Say("could not parse build/a-passed-in-file.json"))
})
})
}, spec.Nested())

when("there is a well-formed JSON file", func() {
when("the file represents a successful build", func() {
Expand Down Expand Up @@ -133,7 +133,7 @@ func TestBuildPassFail(t *testing.T) {
gt.Eventually(session).Should(gexec.Exit(1))
})
})
})
}, spec.Nested(), spec.Parallel())

when("the JSON file is malformed", func() {
it.Before(func() {
Expand All @@ -151,7 +151,7 @@ func TestBuildPassFail(t *testing.T) {
it("fails with an error", func() {
gt.Eventually(session.Err).Should(gbytes.Say("could not parse build/malformed-build.json"))
})
})
}, spec.Nested())
}, spec.Report(report.Terminal{}))

gexec.CleanupBuildArtifacts()
Expand Down

0 comments on commit df7abc6

Please sign in to comment.