本文整理汇总了Golang中github.com/cloudfoundry-incubator/bbs/fake_bbs.FakeClient.ResolveTaskReturns方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeClient.ResolveTaskReturns方法的具体用法?Golang FakeClient.ResolveTaskReturns怎么用?Golang FakeClient.ResolveTaskReturns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry-incubator/bbs/fake_bbs.FakeClient
的用法示例。
在下文中一共展示了FakeClient.ResolveTaskReturns方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
Expect(responseRecorder.Code).To(Equal(http.StatusInternalServerError))
})
It("does not try to resolve the task", func() {
handler.Delete(responseRecorder, request)
Expect(fakeClient.ResolveTaskCallCount()).To(BeZero())
})
})
})
Context("when task cannot be resolved", func() {
BeforeEach(func() {
var err error
request, err = http.NewRequest("", "http://example.com?:task_guid=the-task-guid", nil)
Expect(err).NotTo(HaveOccurred())
fakeClient.ResolveTaskReturns(errors.New("Failed to resolve task"))
})
It("responds with an error", func() {
handler.Delete(responseRecorder, request)
Expect(responseRecorder.Code).To(Equal(http.StatusInternalServerError))
})
})
})
Describe("Cancel", func() {
BeforeEach(func() {
var err error
request, err = http.NewRequest("", "http://example.com?:task_guid=the-task-guid", nil)
Expect(err).NotTo(HaveOccurred())
})