github.com/Thanhphan1147/cloudfoundry-cli@v7.1.0+incompatible/actor/v7pushaction/setup_no_wait_for_push_plan_test.go (about) 1 package v7pushaction_test 2 3 import ( 4 . "code.cloudfoundry.org/cli/actor/v7pushaction" 5 6 . "github.com/onsi/ginkgo" 7 . "github.com/onsi/gomega" 8 ) 9 10 var _ = Describe("SetupNoWaitForPushPlan", func() { 11 var ( 12 pushPlan PushPlan 13 overrides FlagOverrides 14 15 expectedPushPlan PushPlan 16 executeErr error 17 ) 18 19 BeforeEach(func() { 20 pushPlan = PushPlan{} 21 overrides = FlagOverrides{} 22 }) 23 24 JustBeforeEach(func() { 25 expectedPushPlan, executeErr = SetupNoWaitForPushPlan(pushPlan, overrides) 26 }) 27 28 When("flag override specifies no-wait", func() { 29 BeforeEach(func() { 30 overrides.NoWait = true 31 }) 32 33 It("sets the no-wait flag on the push plan", func() { 34 Expect(executeErr).ToNot(HaveOccurred()) 35 Expect(expectedPushPlan.NoWait).To(Equal(true)) 36 }) 37 }) 38 39 When("flag overrides does not specify no-wait", func() { 40 It("leaves the no-wait flag as false on the push plan", func() { 41 Expect(executeErr).ToNot(HaveOccurred()) 42 Expect(expectedPushPlan.NoWait).To(Equal(false)) 43 }) 44 }) 45 })