import ( . "github.com/onsi/ginkgo" "github.com/onsi/ginkgo/config" "github.com/onsi/ginkgo/reporters" st "github.com/onsi/ginkgo/stenographer" "github.com/onsi/ginkgo/types" . "github.com/onsi/gomega" "time" ) var _ = Describe("DefaultReporter", func() { var ( reporter *reporters.DefaultReporter reporterConfig config.DefaultReporterConfigType stenographer *st.FakeStenographer ginkgoConfig config.GinkgoConfigType suite *types.SuiteSummary example *types.ExampleSummary ) BeforeEach(func() { stenographer = st.NewFakeStenographer() reporterConfig = config.DefaultReporterConfigType{ NoColor: false, SlowSpecThreshold: 0.1, NoisyPendings: true, Verbose: true, } reporter = reporters.NewDefaultReporter(reporterConfig, stenographer)
func (reporter *ForwardingReporter) ExampleDidComplete(exampleSummary *types.ExampleSummary) { output, _ := reporter.outputInterceptor.StopInterceptingAndReturnOutput() exampleSummary.CapturedOutput = output reporter.post("/ExampleDidComplete", exampleSummary) }
package remote_test import ( "encoding/json" . "github.com/onsi/ginkgo" "github.com/onsi/ginkgo/config" . "github.com/onsi/ginkgo/remote" "github.com/onsi/ginkgo/types" . "github.com/onsi/gomega" ) var _ = Describe("ForwardingReporter", func() { var ( reporter *ForwardingReporter interceptor *fakeOutputInterceptor poster *fakePoster suiteSummary *types.SuiteSummary exampleSummary *types.ExampleSummary serverHost string ) BeforeEach(func() { serverHost = "127.0.0.1:7788" poster = newFakePoster() interceptor = &fakeOutputInterceptor{ InterceptedOutput: "The intercepted output!", } reporter = NewForwardingReporter(serverHost, poster, interceptor)