Esempio n. 1
0
	AfterEach(func() {
		process.Signal(os.Interrupt)
		Eventually(process.Wait()).Should(Receive())
	})

	Context("when subscribing to the operation stream succeeds", func() {
		var (
			receivedOperations chan<- operationq.Operation
		)

		BeforeEach(func() {
			operations := make(chan operationq.Operation)
			receivedOperations = operations

			fakeGenerator.OperationStreamReturns(operations, nil)
		})

		Context("when an operation is received", func() {
			var fakeOperation *fake_operationq.FakeOperation

			BeforeEach(func() {
				fakeOperation = new(fake_operationq.FakeOperation)
			})

			It("pushes it onto the queue", func() {
				receivedOperations <- fakeOperation

				Eventually(fakeQueue.PushCallCount).Should(Equal(1))
				Expect(fakeQueue.PushArgsForCall(0)).To(Equal(fakeOperation))
			})