示例#1
0
		return spec.New(subject, []*containernode.ContainerNode{}, false)
	}

	newSpecWithBody := func(text string, body interface{}) *spec.Spec {
		subject := leafnodes.NewItNode(text, body, noneFlag, codelocation.New(0), 0, failer, 0)

		return spec.New(subject, []*containernode.ContainerNode{}, false)
	}

	newRunner := func(config config.GinkgoConfigType, beforeSuiteNode leafnodes.SuiteNode, afterSuiteNode leafnodes.SuiteNode, specs ...*spec.Spec) *SpecRunner {
		return New("description", beforeSuiteNode, spec.NewSpecs(specs), afterSuiteNode, []reporters.Reporter{reporter1, reporter2}, writer, config)
	}

	BeforeEach(func() {
		reporter1 = reporters.NewFakeReporter()
		reporter2 = reporters.NewFakeReporter()
		writer = Writer.NewFake()
		failer = Failer.New()

		thingsThatRan = []string{}
	})

	Describe("Running and Reporting", func() {
		var specA, pendingSpec, anotherPendingSpec, failedSpec, specB, skippedSpec *spec.Spec
		var willRunCalls, didCompleteCalls []string
		var conf config.GinkgoConfigType

		JustBeforeEach(func() {
			willRunCalls = []string{}
			didCompleteCalls = []string{}
示例#2
0
	AfterEach(func() {
		server.Close()
	})

	Describe("Streaming endpoints", func() {
		var (
			reporterA, reporterB *reporters.FakeReporter
			forwardingReporter   *ForwardingReporter

			suiteSummary *types.SuiteSummary
			setupSummary *types.SetupSummary
			specSummary  *types.SpecSummary
		)

		BeforeEach(func() {
			reporterA = reporters.NewFakeReporter()
			reporterB = reporters.NewFakeReporter()

			server.RegisterReporters(reporterA, reporterB)

			forwardingReporter = NewForwardingReporter(server.Address(), &http.Client{}, &fakeOutputInterceptor{})

			suiteSummary = &types.SuiteSummary{
				SuiteDescription: "My Test Suite",
			}

			setupSummary = &types.SetupSummary{
				State: types.SpecStatePassed,
			}

			specSummary = &types.SpecSummary{
示例#3
0
	"github.com/cloudfoundry/bosh-init/internal/github.com/onsi/ginkgo/types"
)

var _ = Describe("Suite", func() {
	var (
		specSuite *Suite
		fakeT     *fakeTestingT
		fakeR     *reporters.FakeReporter
		writer    *Writer.FakeGinkgoWriter
		failer    *Failer.Failer
	)

	BeforeEach(func() {
		writer = Writer.NewFake()
		fakeT = &fakeTestingT{}
		fakeR = reporters.NewFakeReporter()
		failer = Failer.New()
		specSuite = New(failer)
	})

	Describe("running a suite", func() {
		var (
			runOrder             []string
			randomizeAllSpecs    bool
			randomSeed           int64
			focusString          string
			parallelNode         int
			parallelTotal        int
			runResult            bool
			hasProgrammaticFocus bool
		)