diff --git a/config/config.go b/config/config.go index 8a2479824..33ac378c5 100644 --- a/config/config.go +++ b/config/config.go @@ -219,10 +219,14 @@ func BuildFlagArgs(prefix string, ginkgo GinkgoConfigType, reporter DefaultRepor // flagFocus implements the -focus flag. func flagFocus(arg string) { - GinkgoConfig.FocusStrings = append(GinkgoConfig.FocusStrings, arg) + if arg != "" { + GinkgoConfig.FocusStrings = append(GinkgoConfig.FocusStrings, arg) + } } // flagSkip implements the -skip flag. func flagSkip(arg string) { - GinkgoConfig.SkipStrings = append(GinkgoConfig.SkipStrings, arg) + if arg != "" { + GinkgoConfig.SkipStrings = append(GinkgoConfig.SkipStrings, arg) + } } diff --git a/integration/flags_test.go b/integration/flags_test.go index 20b049205..fb7b38a29 100644 --- a/integration/flags_test.go +++ b/integration/flags_test.go @@ -118,6 +118,15 @@ var _ = Describe("Flags Specs", func() { Ω(output).Should(ContainSubstring("1 Pending")) Ω(output).Should(ContainSubstring("3 Skipped")) }) + + It("should ignore empty skip and focus variables", func() { + session := startGinkgo(pathToTest, "--noColor", "--skip=", "--focus=") + Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE)) + output := string(session.Out.Contents()) + Ω(output).Should(ContainSubstring("marshmallow")) + Ω(output).Should(ContainSubstring("chocolate")) + }) + It("should run the race detector when told to", func() { if !raceDetectorSupported() { Skip("race detection is not supported")