"github.com/cloudfoundry/dropsonde/emitter" "github.com/cloudfoundry/dropsonde/emitter/fake" "github.com/cloudfoundry/dropsonde/metric_sender" "github.com/cloudfoundry/dropsonde/metricbatcher" "github.com/cloudfoundry/dropsonde/metrics" "github.com/cloudfoundry/loggregatorlib/loggertesthelper" "github.com/gogo/protobuf/proto" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("Truncating Buffer", func() { var inMessageChan chan *events.Envelope var stopChannel chan struct{} var filter func(eventType events.Envelope_EventType) bool var buffer *truncatingbuffer.TruncatingBuffer BeforeEach(func() { filter = nil inMessageChan = make(chan *events.Envelope) stopChannel = make(chan struct{}) }) JustBeforeEach(func() { buffer = truncatingbuffer.NewTruncatingBuffer(inMessageChan, filter, 3, loggertesthelper.Logger(), "dropsonde-origin", "test-sink-name", stopChannel) }) AfterEach(func() { if inMessageChan != nil { close(inMessageChan) }