Expect(fakeClient.JobBuildsCallCount()).To(Equal(1)) pipelineName, jobName, page := fakeClient.JobBuildsArgsForCall(0) Expect(pipelineName).To(Equal("some-pipeline")) Expect(jobName).To(Equal("some-job")) Expect(page).To(Equal(concourse.Page{ Since: 398, Until: 2, })) }) Context("when the job builds lookup returns an error", func() { disaster := errors.New("disaster") BeforeEach(func() { fakeClient.JobBuildsReturns(nil, concourse.Pagination{}, false, disaster) }) It("returns the error", func() { Expect(fetchErr).To(Equal(disaster)) }) }) Context("when the job builds lookup returns a build", func() { var buildsWithResources []BuildWithInputsOutputs var builds []atc.Build var pagination concourse.Pagination BeforeEach(func() { endTime := time.Now()