JustBeforeEach(func() { err := session.AcquireLock("a-key", []byte("a-value")) Expect(err).NotTo(HaveOccurred()) Eventually(func() []*api.SessionEntry { entries, _, err := client.Session().List(nil) Expect(err).NotTo(HaveOccurred()) return entries }).Should(HaveLen(1)) session.Destroy() }) It("destroys the session", func() { Expect(sessionMgr.DestroyCallCount()).To(Equal(1)) id, _ := sessionMgr.DestroyArgsForCall(0) Expect(id).To(Equal(session.ID())) }) It("removes the session", func() { Eventually(func() *api.SessionEntry { entries, _, err := client.Session().List(nil) Expect(err).NotTo(HaveOccurred()) return findSession(session.ID(), entries) }).Should(BeNil()) }) It("sends a nil error", func() { Eventually(session.Err()).Should(Receive(BeNil())) })