Skip to content

Commit

Permalink
Change order of CLI test assertions
Browse files Browse the repository at this point in the history
So that you get useful error messages from STDERR before comparing
whether the exit code is correct or not.
  • Loading branch information
dcarley committed Jun 13, 2018
1 parent 6760da2 commit 373ca9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ var _ = Describe("Root", func() {
command := exec.Command(pathCLI, "--help")
session, err := gexec.Start(command, GinkgoWriter, GinkgoWriter)
Expect(err).ShouldNot(HaveOccurred())
Eventually(session).Should(gexec.Exit(0))
Eventually(session.Out).Should(gbytes.Say("Usage:"))
Eventually(session.Err.Contents()).Should(BeEmpty())
Eventually(session.Out).Should(gbytes.Say("Usage:"))
Eventually(session).Should(gexec.Exit(0))
})
})
})

0 comments on commit 373ca9a

Please sign in to comment.