github.com/randomtask1155/cli@v6.41.1-0.20181227003417-a98eed78cbde+incompatible/actor/pushaction/pushaction_suite_test.go (about) 1 package pushaction_test 2 3 import ( 4 "os" 5 "time" 6 7 . "code.cloudfoundry.org/cli/actor/pushaction" 8 "code.cloudfoundry.org/cli/actor/pushaction/pushactionfakes" 9 . "github.com/onsi/ginkgo" 10 . "github.com/onsi/gomega" 11 . "github.com/onsi/gomega/types" 12 13 "testing" 14 15 log "github.com/sirupsen/logrus" 16 ) 17 18 func TestPushAction(t *testing.T) { 19 RegisterFailHandler(Fail) 20 RunSpecs(t, "Push Actions Suite") 21 } 22 23 var _ = BeforeEach(func() { 24 SetDefaultEventuallyTimeout(3 * time.Second) 25 log.SetLevel(log.PanicLevel) 26 }) 27 28 func EqualEither(events ...Event) GomegaMatcher { 29 var equals []GomegaMatcher 30 for _, event := range events { 31 equals = append(equals, Equal(event)) 32 } 33 34 return Or(equals...) 35 } 36 37 func getCurrentDir() string { 38 pwd, err := os.Getwd() 39 Expect(err).NotTo(HaveOccurred()) 40 return pwd 41 } 42 43 func getTestPushActor() (*Actor, *pushactionfakes.FakeV2Actor, *pushactionfakes.FakeV3Actor, *pushactionfakes.FakeSharedActor) { 44 fakeV2Actor := new(pushactionfakes.FakeV2Actor) 45 fakeV3Actor := new(pushactionfakes.FakeV3Actor) 46 fakeSharedActor := new(pushactionfakes.FakeSharedActor) 47 actor := NewActor(fakeV2Actor, fakeV3Actor, fakeSharedActor) 48 return actor, fakeV2Actor, fakeV3Actor, fakeSharedActor 49 }