} }) It("should be set up correctly", func() { session = startGinkgoWithGopath("-r") Eventually(session).Should(gexec.Exit(0)) Ω(session.Out.Contents()).Should(ContainSubstring("A Suite")) Ω(session.Out.Contents()).Should(ContainSubstring("B Suite")) Ω(session.Out.Contents()).Should(ContainSubstring("C Suite")) Ω(session.Out.Contents()).Should(ContainSubstring("Ginkgo ran 3 suites")) }) Context("when watching just one test suite", func() { It("should immediately run, and should rerun when the test suite changes", func() { session = startGinkgoWithGopath("watch", "-succinct", pathA) Eventually(session).Should(gbytes.Say("A Suite")) modifyCode("A") Eventually(session).Should(gbytes.Say("Detected changes in")) Eventually(session).Should(gbytes.Say("A Suite")) session.Kill().Wait() }) }) Context("when watching several test suites", func() { It("should not immediately run, but should rerun a test when its code changes", func() { session = startGinkgoWithGopath("watch", "-succinct", "-r") Eventually(session).Should(gbytes.Say("Identified 3 test suites")) Consistently(session).ShouldNot(gbytes.Say("A Suite|B Suite|C Suite")) modifyCode("A") Eventually(session).Should(gbytes.Say("Detected changes in")) Eventually(session).Should(gbytes.Say("A Suite"))
}) }) Context("when told to randomizeSuites", func() { BeforeEach(func() { pathToTest = tmpPath("ginkgo") otherPathToTest := tmpPath("other") copyIn("passing_ginkgo_tests", pathToTest) copyIn("more_ginkgo_tests", otherPathToTest) }) It("should skip packages that match the regexp", func() { session := startGinkgo(tmpDir, "--noColor", "--randomizeSuites", "-r", "--seed=2") Eventually(session).Should(gexec.Exit(0)) Ω(session).Should(gbytes.Say("More_ginkgo_tests Suite")) Ω(session).Should(gbytes.Say("Passing_ginkgo_tests Suite")) session = startGinkgo(tmpDir, "--noColor", "--randomizeSuites", "-r", "--seed=3") Eventually(session).Should(gexec.Exit(0)) Ω(session).Should(gbytes.Say("Passing_ginkgo_tests Suite")) Ω(session).Should(gbytes.Say("More_ginkgo_tests Suite")) }) }) Context("when pointed at a package with xunit style tests", func() { BeforeEach(func() { pathToTest = tmpPath("xunit") copyIn("xunit_tests", pathToTest) })