From 373ca9ac93396b10db7d419cedeb6de00210ca5d Mon Sep 17 00:00:00 2001 From: Dan Carley Date: Wed, 13 Jun 2018 11:48:06 +0100 Subject: [PATCH] Change order of CLI test assertions So that you get useful error messages from STDERR before comparing whether the exit code is correct or not. --- cmd/root_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/root_test.go b/cmd/root_test.go index 637a8ae6b..fdf3eec91 100644 --- a/cmd/root_test.go +++ b/cmd/root_test.go @@ -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)) }) }) })