Example #1
0
		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{}
			specA = newSpec("spec A", noneFlag, false)
			pendingSpec = newSpec("pending spec", pendingFlag, false)
			anotherPendingSpec = newSpec("another pending spec", pendingFlag, false)
			failedSpec = newSpec("failed spec", noneFlag, true)
			specB = newSpec("spec B", noneFlag, false)
			skippedSpec = newSpec("skipped spec", noneFlag, false)
			skippedSpec.Skip()

			reporter1.SpecWillRunStub = func(specSummary *types.SpecSummary) {
				willRunCalls = append(willRunCalls, "Reporter1")
			}
	"time"

	. "github.com/cloudfoundry/bosh-agent/internal/github.com/onsi/ginkgo"
	"github.com/cloudfoundry/bosh-agent/internal/github.com/onsi/ginkgo/config"
	"github.com/cloudfoundry/bosh-agent/internal/github.com/onsi/ginkgo/reporters"
	st "github.com/cloudfoundry/bosh-agent/internal/github.com/onsi/ginkgo/reporters/stenographer"
	"github.com/cloudfoundry/bosh-agent/internal/github.com/onsi/ginkgo/types"
	. "github.com/cloudfoundry/bosh-agent/internal/github.com/onsi/gomega"
)

var _ = Describe("DefaultReporter", func() {
	var (
		reporter       *reporters.DefaultReporter
		reporterConfig config.DefaultReporterConfigType
		stenographer   *st.FakeStenographer

		ginkgoConfig config.GinkgoConfigType
		suite        *types.SuiteSummary
		spec         *types.SpecSummary
	)

	BeforeEach(func() {
		stenographer = st.NewFakeStenographer()
		reporterConfig = config.DefaultReporterConfigType{
			NoColor:           false,
			SlowSpecThreshold: 0.1,
			NoisyPendings:     true,
			Verbose:           true,
			FullTrace:         true,
		}