}) Expect(err).ToNot(HaveOccurred()) Expect(installationArgumentToFunction).ToNot(BeNil()) Expect(installationArgumentToFunction).To(Equal(installation)) }) It("starts an 'installing CPI stage' and passes it to the installer", func() { cpiInstaller := release.CpiInstaller{ InstallerFactory: mockInstallerFactory, } var stageForInstall ui.Stage expectInstall.Do(func(manifest biinstallationmanifest.Manifest, stage ui.Stage) { stageForInstall = stage }).Return(installation, nil) err := cpiInstaller.WithInstalledCpiRelease(installationManifest, target, installStage, func(installation biinstallation.Installation) error { return nil }) Expect(err).ToNot(HaveOccurred()) Expect(stageForInstall).To(fakeui.BeASubstageOf(installStage)) Expect(installStage.PerformCalls).To(ContainElement( &fakeui.PerformCall{ Name: "installing CPI", Stage: fakeui.NewFakeStage(), }, )) })