6
6
"code.cloudfoundry.org/cli/actor/actionerror"
7
7
"code.cloudfoundry.org/cli/actor/v7action"
8
8
"code.cloudfoundry.org/cli/command/commandfakes"
9
+ "code.cloudfoundry.org/cli/command/translatableerror"
9
10
. "code.cloudfoundry.org/cli/command/v7"
10
11
"code.cloudfoundry.org/cli/command/v7/v7fakes"
11
12
"code.cloudfoundry.org/cli/util/ui"
@@ -32,6 +33,7 @@ var _ = Describe("delete-buildpack Command", func() {
32
33
input = NewBuffer ()
33
34
fakeActor = new (v7fakes.FakeActor )
34
35
fakeConfig = new (commandfakes.FakeConfig )
36
+ fakeConfig .APIVersionReturns ("4.0.0" )
35
37
fakeSharedActor = new (commandfakes.FakeSharedActor )
36
38
testUI = ui .NewTestUI (input , NewBuffer (), NewBuffer ())
37
39
@@ -50,6 +52,23 @@ var _ = Describe("delete-buildpack Command", func() {
50
52
cmd .Force = true
51
53
})
52
54
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
+
53
72
When ("checking target fails" , func () {
54
73
BeforeEach (func () {
55
74
fakeSharedActor .CheckTargetReturns (actionerror.NotLoggedInError {BinaryName : binaryName })
0 commit comments