Skip to content

Commit 5a73661

Browse files
committed
possible option to prevent errors on mult imports
1 parent d848015 commit 5a73661

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

ginkgo_dsl.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,17 @@ const defaultTimeout = 1
5151
var globalSuite *suite.Suite
5252
var globalFailer *failer.Failer
5353

54+
var instance = 0
55+
5456
func init() {
55-
config.Flags(flag.CommandLine, "ginkgo", true)
56-
GinkgoWriter = writer.New(os.Stdout)
57-
globalFailer = failer.New()
58-
globalSuite = suite.New(globalFailer)
57+
if instance == 0 {
58+
config.Flags(flag.CommandLine, "ginkgo", true)
59+
GinkgoWriter = writer.New(os.Stdout)
60+
globalFailer = failer.New()
61+
globalSuite = suite.New(globalFailer)
62+
}
63+
config.Flags(flag.CommandLine, fmt.Sprintf("ginkgo%d", instance), true)
64+
instance++
5965
}
6066

6167
//GinkgoWriter implements an io.Writer

0 commit comments

Comments
 (0)