File: globals_test.go

package info (click to toggle)
golang-github-onsi-ginkgo-v2 2.15.0-1~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 4,112 kB
  • sloc: javascript: 59; sh: 14; makefile: 7
file content (26 lines) | stat: -rw-r--r-- 490 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package globals_test

import (
	"testing"

	"github.com/onsi/ginkgo/v2/extensions/globals"
	"github.com/onsi/ginkgo/v2/internal/global"
)

func TestGlobals(t *testing.T) {
	global.InitializeGlobals()
	oldSuite := global.Suite
	if oldSuite == nil {
		t.Error("global.Suite was nil")
	}

	globals.Reset()
	newSuite := global.Suite
	if newSuite == nil {
		t.Error("new global.Suite was nil")
	}

	if oldSuite == newSuite {
		t.Error("got the same suite but expected it to be different!")
	}
}