@@ -154,6 +154,9 @@ var _ = Describe("restart Command", func() {
154154 BeforeEach (func () {
155155 cmd .Strategy = flag.DeploymentStrategy {Name : constant .DeploymentStrategyCanary }
156156 cmd .InstanceSteps = "1,2,4"
157+ fakeConfig = & commandfakes.FakeConfig {}
158+ fakeConfig .APIVersionReturns ("4.0.0" )
159+ cmd .Config = fakeConfig
157160 })
158161
159162 It ("starts the app with the current droplet" , func () {
@@ -209,6 +212,10 @@ var _ = Describe("restart Command", func() {
209212 BeforeEach (func () {
210213 cmd .Strategy = flag.DeploymentStrategy {Name : constant .DeploymentStrategyCanary }
211214 cmd .InstanceSteps = "1,2,4"
215+
216+ fakeConfig = & commandfakes.FakeConfig {}
217+ fakeConfig .APIVersionReturns ("4.0.0" )
218+ cmd .Config = fakeConfig
212219 })
213220
214221 It ("starts the app with the current droplet" , func () {
@@ -297,5 +304,19 @@ var _ = Describe("restart Command", func() {
297304 ArgumentName : "--instance-steps" ,
298305 ExpectedType : "list of weights" ,
299306 }),
307+
308+ Entry ("instance-steps used when CAPI does not support canary steps" ,
309+ func () {
310+ cmd .InstanceSteps = "1,2,3"
311+ cmd .Strategy .Name = constant .DeploymentStrategyCanary
312+ fakeConfig = & commandfakes.FakeConfig {}
313+ fakeConfig .APIVersionReturns ("3.0.0" )
314+ cmd .Config = fakeConfig
315+ },
316+ translatableerror.MinimumCFAPIVersionNotMetError {
317+ Command : "--instance-steps" ,
318+ CurrentVersion : "3.0.0" ,
319+ MinimumVersion : "3.254.0" ,
320+ }),
300321 )
301322})
0 commit comments