finishErr error
								aborted   bool
								succeeded exec.Success
							)

							Context("with success", func() {
								BeforeEach(func() {
									finishErr = nil
									succeeded = true
									aborted = false
								})

								It("saves the input as an implicit output", func() {
									delegate.Finish(logger, finishErr, succeeded, aborted)

									Ω(fakeDB.SaveBuildOutputCallCount()).Should(Equal(1))

									buildID, savedOutput, explicit := fakeDB.SaveBuildOutputArgsForCall(0)
									Ω(buildID).Should(Equal(42))
									Ω(savedOutput).Should(Equal(db.VersionedResource{
										PipelineName: "some-pipeline",
										Resource:     "some-input-resource",
										Type:         "some-type",
										Source:       db.Source{"some": "source"},
										Version:      db.Version{"result": "version"},
										Metadata:     []db.MetadataField{{"result", "metadata"}},
									}))
									Ω(explicit).Should(BeFalse())
								})
							})
								finishErr error
								aborted   bool
								succeeded exec.Success
							)

							Context("with success", func() {
								BeforeEach(func() {
									finishErr = nil
									succeeded = true
									aborted = false
								})

								It("saves the input as an implicit output", func() {
									delegate.Finish(logger, finishErr, succeeded, aborted)

									Expect(fakeDB.SaveBuildOutputCallCount()).To(Equal(1))

									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{"result": "version"},
										Metadata:     []db.MetadataField{{"result", "metadata"}},
									}))

									Expect(explicit).To(BeFalse())
								})
							})