Пример #1
0
			})

			It("deletes the container", func() {
				Expect(executorClient.DeleteContainerCallCount()).To(Equal(1))
				_, containerGuid := executorClient.DeleteContainerArgsForCall(0)
				Expect(containerGuid).To(Equal(expectedGuid))
			})

			It("logs the deletion", func() {
				Expect(logger).To(gbytes.Say(sessionPrefix + ".deleting-container"))
				Expect(logger).To(gbytes.Say(sessionPrefix + ".succeeded-deleting-container"))
			})

			Context("when deleting fails", func() {
				BeforeEach(func() {
					executorClient.DeleteContainerReturns(errors.New("boom"))
				})

				It("logs the failure", func() {
					Expect(logger).To(gbytes.Say(sessionPrefix + ".failed-deleting-container"))
				})
			})
		})
	})

	Describe("StopContainer", func() {
		var result bool

		JustBeforeEach(func() {
			result = containerDelegate.StopContainer(logger, expectedGuid)
		})