buildID, savedOutput, explicit := fakeDB.SaveBuildOutputArgsForCall(0) Expect(buildID).To(Equal(42)) Expect(savedOutput).To(Equal(db.VersionedResource{ PipelineName: "some-pipeline", Resource: "some-input-resource", Type: "some-type", Version: db.Version{"explicit": "version"}, Metadata: []db.MetadataField{{"explicit", "metadata"}}, })) Expect(explicit).To(BeTrue()) }) Context("when the pipeline name is empty because of a one-off build", func() { BeforeEach(func() { putPlan.Pipeline = "" outputDelegate = delegate.OutputDelegate(logger, putPlan, location) }) It("does not save it as an output", func() { delegate.Finish(logger, finishErr, succeeded, aborted) Expect(fakeDB.SaveBuildOutputCallCount()).To(BeZero()) }) }) }) }) }) }) })