Ejemplo n.º 1
0
		It("fails requirements", func() {
			runCommand("-f", "my-buildpack")

			Expect(testcmd.CommandDidPassRequirements).To(BeFalse())
		})
	})

	Context("when the user is logged in", func() {
		BeforeEach(func() {
			requirementsFactory.LoginSuccess = true
		})

		Context("when the buildpack exists", func() {
			BeforeEach(func() {
				buildpackRepo.FindByNameBuildpack = models.Buildpack{
					Name: "my-buildpack",
					Guid: "my-buildpack-guid",
				}
			})

			It("deletes the buildpack", func() {
				ui = &testterm.FakeUI{Inputs: []string{"y"}}

				runCommand("my-buildpack")

				Expect(buildpackRepo.DeleteBuildpackGuid).To(Equal("my-buildpack-guid"))

				testassert.SliceContains(ui.Prompts, testassert.Lines{
					{"delete the buildpack my-buildpack"},
				})
				testassert.SliceContains(ui.Outputs, testassert.Lines{
					{"Deleting buildpack", "my-buildpack"},