Describe("stopping", func() { It("stops the container and sends a StopResponse", func() { err := container.Stop(true) Ω(err).ShouldNot(HaveOccurred()) Ω(fakeContainer.StopArgsForCall(0)).Should(Equal(true)) }) itFailsWhenTheContainerIsNotFound(func() error { return container.Stop(true) }) Context("when stopping the container fails", func() { BeforeEach(func() { fakeContainer.StopReturns(errors.New("oh no!")) }) It("returns an error", func() { err := container.Stop(true) Ω(err).Should(HaveOccurred()) }) }) itResetsGraceTimeWhenHandling( func() { err := container.Stop(false) Ω(err).ShouldNot(HaveOccurred()) }, ) })