Expect(containerDelegate.DeleteContainerCallCount()).To(Equal(1)) delegateLogger, containerGuid := containerDelegate.DeleteContainerArgsForCall(0) Expect(containerGuid).To(Equal(container.Guid)) Expect(delegateLogger.SessionName()).To(Equal(expectedSessionName)) }) }) }) Context("and the container was not requested to stop", func() { BeforeEach(func() { container.RunResult.Stopped = false container.RunResult.FailureReason = "crashed" }) It("crashes the actual LRP", func() { Expect(bbsClient.CrashActualLRPCallCount()).To(Equal(1)) lrpKey, instanceKey, reason := bbsClient.CrashActualLRPArgsForCall(0) Expect(*lrpKey).To(Equal(expectedLrpKey)) Expect(*instanceKey).To(Equal(expectedInstanceKey)) Expect(reason).To(Equal("crashed")) }) It("deletes the container", func() { Expect(containerDelegate.DeleteContainerCallCount()).To(Equal(1)) delegateLogger, containerGuid := containerDelegate.DeleteContainerArgsForCall(0) Expect(containerGuid).To(Equal(container.Guid)) Expect(delegateLogger.SessionName()).To(Equal(expectedSessionName)) }) }) })