66 "code.cloudfoundry.org/cli/actor/actionerror"
77 "code.cloudfoundry.org/cli/actor/v7action"
88 "code.cloudfoundry.org/cli/command/commandfakes"
9+ "code.cloudfoundry.org/cli/command/translatableerror"
910 . "code.cloudfoundry.org/cli/command/v7"
1011 "code.cloudfoundry.org/cli/command/v7/v7fakes"
1112 "code.cloudfoundry.org/cli/util/ui"
@@ -32,6 +33,7 @@ var _ = Describe("delete-buildpack Command", func() {
3233 input = NewBuffer ()
3334 fakeActor = new (v7fakes.FakeActor )
3435 fakeConfig = new (commandfakes.FakeConfig )
36+ fakeConfig .APIVersionReturns ("4.0.0" )
3537 fakeSharedActor = new (commandfakes.FakeSharedActor )
3638 testUI = ui .NewTestUI (input , NewBuffer (), NewBuffer ())
3739
@@ -50,6 +52,23 @@ var _ = Describe("delete-buildpack Command", func() {
5052 cmd .Force = true
5153 })
5254
55+ When ("--lifecyle is provided" , func () {
56+ JustBeforeEach (func () {
57+ cmd .Lifecycle = "some-lifecycle"
58+ fakeConfig .APIVersionReturns ("3.192.0" )
59+ })
60+ It ("fails when the cc version is below the minimum" , func () {
61+ executeErr = cmd .Execute (nil )
62+
63+ Expect (executeErr ).To (MatchError (translatableerror.MinimumCFAPIVersionNotMetError {
64+ Command : "--lifecycle" ,
65+ CurrentVersion : "3.192.0" ,
66+ MinimumVersion : "3.193.0" ,
67+ }))
68+ })
69+
70+ })
71+
5372 When ("checking target fails" , func () {
5473 BeforeEach (func () {
5574 fakeSharedActor .CheckTargetReturns (actionerror.NotLoggedInError {BinaryName : binaryName })
0 commit comments