diff --git a/fetcher/fetcher_test.go b/fetcher/fetcher_test.go index da871aaa..90fcdddc 100644 --- a/fetcher/fetcher_test.go +++ b/fetcher/fetcher_test.go @@ -1,14 +1,14 @@ package fetcher import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" + "github.com/onsi/ginkgo" + "github.com/onsi/gomega" "github.com/bosh-prometheus/cf_exporter/filters" ) -var _ = Describe("Fetcher", func() { - Context("fetching jobs are planned according to filter", func() { +var _ = ginkgo.Describe("Fetcher", func() { + ginkgo.Context("fetching jobs are planned according to filter", func() { var ( fetcher *Fetcher active []string @@ -16,11 +16,11 @@ var _ = Describe("Fetcher", func() { expected []string ) - JustBeforeEach(func() { + ginkgo.JustBeforeEach(func() { f, err := filters.NewFilter(active...) - Ω(err).ShouldNot(HaveOccurred()) + gomega.Ω(err).ShouldNot(gomega.HaveOccurred()) fetcher = NewFetcher(10, &CFConfig{}, f) - Ω(fetcher).ShouldNot(BeNil()) + gomega.Ω(fetcher).ShouldNot(gomega.BeNil()) fetcher.workInit() close(fetcher.worker.list) @@ -30,8 +30,8 @@ var _ = Describe("Fetcher", func() { } }) - When("default filters are set", func() { - BeforeEach(func() { + ginkgo.When("default filters are set", func() { + ginkgo.BeforeEach(func() { active = []string{} expected = []string{ "info", @@ -54,13 +54,13 @@ var _ = Describe("Fetcher", func() { "segments", } }) - It("plans all jobs", func() { - Ω(jobs).Should(ConsistOf(expected)) + ginkgo.It("plans all jobs", func() { + gomega.Ω(jobs).Should(gomega.ConsistOf(expected)) }) }) - When("all filters are set", func() { - BeforeEach(func() { + ginkgo.When("all filters are set", func() { + ginkgo.BeforeEach(func() { active = filters.All expected = []string{ "info", @@ -86,138 +86,138 @@ var _ = Describe("Fetcher", func() { "events", } }) - It("plans all jobs", func() { - Ω(jobs).Should(ConsistOf(expected)) + ginkgo.It("plans all jobs", func() { + gomega.Ω(jobs).Should(gomega.ConsistOf(expected)) }) }) - When("org filter is set", func() { - BeforeEach(func() { + ginkgo.When("org filter is set", func() { + ginkgo.BeforeEach(func() { active = []string{filters.Organizations} expected = []string{"info", "organizations", "org_quotas"} }) - It("plans only specific jobs", func() { - Ω(jobs).Should(ConsistOf(expected)) + ginkgo.It("plans only specific jobs", func() { + gomega.Ω(jobs).Should(gomega.ConsistOf(expected)) }) }) - When("space filter is set", func() { - BeforeEach(func() { + ginkgo.When("space filter is set", func() { + ginkgo.BeforeEach(func() { active = []string{filters.Spaces} expected = []string{"info", "spaces", "space_quotas"} }) - It("plans only specific jobs", func() { - Ω(jobs).Should(ConsistOf(expected)) + ginkgo.It("plans only specific jobs", func() { + gomega.Ω(jobs).Should(gomega.ConsistOf(expected)) }) }) - When("buildpack filter is set", func() { - BeforeEach(func() { + ginkgo.When("buildpack filter is set", func() { + ginkgo.BeforeEach(func() { active = []string{filters.Buildpacks} expected = []string{"info", "buildpacks"} }) - It("plans only specific jobs", func() { - Ω(jobs).Should(ConsistOf(expected)) + ginkgo.It("plans only specific jobs", func() { + gomega.Ω(jobs).Should(gomega.ConsistOf(expected)) }) }) - When("tasks filter is set", func() { - BeforeEach(func() { + ginkgo.When("tasks filter is set", func() { + ginkgo.BeforeEach(func() { active = []string{filters.Tasks} expected = []string{"info", "tasks"} }) - It("plans only specific jobs", func() { - Ω(jobs).Should(ConsistOf(expected)) + ginkgo.It("plans only specific jobs", func() { + gomega.Ω(jobs).Should(gomega.ConsistOf(expected)) }) }) - When("isolationsegments filter is set", func() { - BeforeEach(func() { + ginkgo.When("isolationsegments filter is set", func() { + ginkgo.BeforeEach(func() { active = []string{filters.IsolationSegments} expected = []string{"info", "segments"} }) - It("plans only specific jobs", func() { - Ω(jobs).Should(ConsistOf(expected)) + ginkgo.It("plans only specific jobs", func() { + gomega.Ω(jobs).Should(gomega.ConsistOf(expected)) }) }) - When("routes filter is set", func() { - BeforeEach(func() { + ginkgo.When("routes filter is set", func() { + ginkgo.BeforeEach(func() { active = []string{filters.Routes} expected = []string{"info", "routes", "route_services"} }) - It("plans only specific jobs", func() { - Ω(jobs).Should(ConsistOf(expected)) + ginkgo.It("plans only specific jobs", func() { + gomega.Ω(jobs).Should(gomega.ConsistOf(expected)) }) }) - When("securitygroups filter is set", func() { - BeforeEach(func() { + ginkgo.When("securitygroups filter is set", func() { + ginkgo.BeforeEach(func() { active = []string{filters.SecurityGroups} expected = []string{"info", "security_groups"} }) - It("plans only specific jobs", func() { - Ω(jobs).Should(ConsistOf(expected)) + ginkgo.It("plans only specific jobs", func() { + gomega.Ω(jobs).Should(gomega.ConsistOf(expected)) }) }) - When("servicebindings filter is set", func() { - BeforeEach(func() { + ginkgo.When("servicebindings filter is set", func() { + ginkgo.BeforeEach(func() { active = []string{filters.ServiceBindings} expected = []string{"info", "service_bindings"} }) - It("plans only specific jobs", func() { - Ω(jobs).Should(ConsistOf(expected)) + ginkgo.It("plans only specific jobs", func() { + gomega.Ω(jobs).Should(gomega.ConsistOf(expected)) }) }) - When("serviceinstances filter is set", func() { - BeforeEach(func() { + ginkgo.When("serviceinstances filter is set", func() { + ginkgo.BeforeEach(func() { active = []string{filters.ServiceInstances} expected = []string{"info", "service_instances"} }) - It("plans only specific jobs", func() { - Ω(jobs).Should(ConsistOf(expected)) + ginkgo.It("plans only specific jobs", func() { + gomega.Ω(jobs).Should(gomega.ConsistOf(expected)) }) }) - When("services filter is set", func() { - BeforeEach(func() { + ginkgo.When("services filter is set", func() { + ginkgo.BeforeEach(func() { active = []string{filters.Services} expected = []string{"info", "service_brokers", "service_offerings"} }) - It("plans only specific jobs", func() { - Ω(jobs).Should(ConsistOf(expected)) + ginkgo.It("plans only specific jobs", func() { + gomega.Ω(jobs).Should(gomega.ConsistOf(expected)) }) }) - When("stacks filter is set", func() { - BeforeEach(func() { + ginkgo.When("stacks filter is set", func() { + ginkgo.BeforeEach(func() { active = []string{filters.Stacks} expected = []string{"info", "stacks"} }) - It("plans only specific jobs", func() { - Ω(jobs).Should(ConsistOf(expected)) + ginkgo.It("plans only specific jobs", func() { + gomega.Ω(jobs).Should(gomega.ConsistOf(expected)) }) }) - When("applications filter is set", func() { - BeforeEach(func() { + ginkgo.When("applications filter is set", func() { + ginkgo.BeforeEach(func() { active = []string{filters.Applications} expected = []string{"info", "organizations", "spaces", "applications", "process"} }) - It("plans only specific jobs", func() { - Ω(jobs).Should(ConsistOf(expected)) + ginkgo.It("plans only specific jobs", func() { + gomega.Ω(jobs).Should(gomega.ConsistOf(expected)) }) }) - When("events filter is set", func() { - BeforeEach(func() { + ginkgo.When("events filter is set", func() { + ginkgo.BeforeEach(func() { active = []string{filters.Events} expected = []string{"info", "users", "events"} }) - It("plans only specific jobs", func() { - Ω(jobs).Should(ConsistOf(expected)) + ginkgo.It("plans only specific jobs", func() { + gomega.Ω(jobs).Should(gomega.ConsistOf(expected)) }) }) diff --git a/fetcher/sessionext_test.go b/fetcher/sessionext_test.go index d5d3b4a2..c7d031ca 100644 --- a/fetcher/sessionext_test.go +++ b/fetcher/sessionext_test.go @@ -10,8 +10,8 @@ import ( "github.com/onsi/gomega/ghttp" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" + "github.com/onsi/ginkgo" + "github.com/onsi/gomega" "encoding/json" "net/http" @@ -34,11 +34,11 @@ func serializeList[T any](obj ...T) string { func serialize[T any](obj T) string { content, err := json.Marshal(obj) - Ω(err).ShouldNot(HaveOccurred()) + gomega.Ω(err).ShouldNot(gomega.HaveOccurred()) return string(content) } -var _ = Describe("Extensions", func() { +var _ = ginkgo.Describe("Extensions", func() { var ( err error @@ -47,7 +47,7 @@ var _ = Describe("Extensions", func() { config *CFConfig ) - BeforeEach(func() { + ginkgo.BeforeEach(func() { tokenResponse := fmt.Sprintf(`{"access_token": "%s", "refresh_token": "value"}`, fakeToken) server = ghttp.NewServer() @@ -90,16 +90,16 @@ var _ = Describe("Extensions", func() { ClientSecret: "fake", } target, err = NewSessionExt(config) - Ω(err).ShouldNot(HaveOccurred()) - Ω(target).ShouldNot(BeNil()) + gomega.Ω(err).ShouldNot(gomega.HaveOccurred()) + gomega.Ω(target).ShouldNot(gomega.BeNil()) }) - AfterEach(func() { + ginkgo.AfterEach(func() { server.Close() }) - Context("fetching applications", func() { - It("no error occurs", func() { + ginkgo.Context("fetching applications", func() { + ginkgo.It("no error occurs", func() { server.AppendHandlers( ghttp.CombineHandlers( ghttp.VerifyRequest("GET", "/v3/apps", "per_page=5000"), @@ -114,15 +114,15 @@ var _ = Describe("Extensions", func() { ), ) app, err := target.GetApplications() - Ω(err).ShouldNot(HaveOccurred()) - Ω(app).Should(HaveLen(1)) - Ω(app[0].GUID).Should(Equal("app1-guid")) - Ω(app[0].Name).Should(Equal("app1")) + gomega.Ω(err).ShouldNot(gomega.HaveOccurred()) + gomega.Ω(app).Should(gomega.HaveLen(1)) + gomega.Ω(app[0].GUID).Should(gomega.Equal("app1-guid")) + gomega.Ω(app[0].Name).Should(gomega.Equal("app1")) }) }) - Context("fetching tasks", func() { - It("no error occurs", func() { + ginkgo.Context("fetching tasks", func() { + ginkgo.It("no error occurs", func() { server.AppendHandlers( ghttp.CombineHandlers( ghttp.VerifyRequest("GET", "/v3/tasks", "per_page=5000&states=PENDING,RUNNING,CANCELING"), @@ -139,17 +139,17 @@ var _ = Describe("Extensions", func() { ), ) objs, err := target.GetTasks() - Ω(err).ShouldNot(HaveOccurred()) - Ω(objs).Should(HaveLen(2)) - Ω(objs[0].GUID).Should(Equal("guid1")) - Ω(objs[0].State).Should(Equal(constant.TaskPending)) - Ω(objs[1].GUID).Should(Equal("guid2")) - Ω(objs[1].State).Should(Equal(constant.TaskCanceling)) + gomega.Ω(err).ShouldNot(gomega.HaveOccurred()) + gomega.Ω(objs).Should(gomega.HaveLen(2)) + gomega.Ω(objs[0].GUID).Should(gomega.Equal("guid1")) + gomega.Ω(objs[0].State).Should(gomega.Equal(constant.TaskPending)) + gomega.Ω(objs[1].GUID).Should(gomega.Equal("guid2")) + gomega.Ω(objs[1].State).Should(gomega.Equal(constant.TaskCanceling)) }) }) - Context("fetching org quotas", func() { - It("no error occurs", func() { + ginkgo.Context("fetching org quotas", func() { + ginkgo.It("no error occurs", func() { server.AppendHandlers( ghttp.CombineHandlers( ghttp.VerifyRequest("GET", "/v3/organization_quotas", "per_page=5000"), @@ -166,17 +166,17 @@ var _ = Describe("Extensions", func() { ), ) objs, err := target.GetOrganizationQuotas() - Ω(err).ShouldNot(HaveOccurred()) - Ω(objs).Should(HaveLen(2)) - Ω(objs[0].GUID).Should(Equal("guid1")) - Ω(objs[0].Name).Should(Equal("quota1")) - Ω(objs[1].GUID).Should(Equal("guid2")) - Ω(objs[1].Name).Should(Equal("quota2")) + gomega.Ω(err).ShouldNot(gomega.HaveOccurred()) + gomega.Ω(objs).Should(gomega.HaveLen(2)) + gomega.Ω(objs[0].GUID).Should(gomega.Equal("guid1")) + gomega.Ω(objs[0].Name).Should(gomega.Equal("quota1")) + gomega.Ω(objs[1].GUID).Should(gomega.Equal("guid2")) + gomega.Ω(objs[1].Name).Should(gomega.Equal("quota2")) }) }) - Context("fetching space quotas", func() { - It("no error occurs", func() { + ginkgo.Context("fetching space quotas", func() { + ginkgo.It("no error occurs", func() { server.AppendHandlers( ghttp.CombineHandlers( ghttp.VerifyRequest("GET", "/v3/space_quotas", "per_page=5000"), @@ -193,17 +193,17 @@ var _ = Describe("Extensions", func() { ), ) objs, err := target.GetSpaceQuotas() - Ω(err).ShouldNot(HaveOccurred()) - Ω(objs).Should(HaveLen(2)) - Ω(objs[0].GUID).Should(Equal("guid1")) - Ω(objs[0].Name).Should(Equal("quota1")) - Ω(objs[1].GUID).Should(Equal("guid2")) - Ω(objs[1].Name).Should(Equal("quota2")) + gomega.Ω(err).ShouldNot(gomega.HaveOccurred()) + gomega.Ω(objs).Should(gomega.HaveLen(2)) + gomega.Ω(objs[0].GUID).Should(gomega.Equal("guid1")) + gomega.Ω(objs[0].Name).Should(gomega.Equal("quota1")) + gomega.Ω(objs[1].GUID).Should(gomega.Equal("guid2")) + gomega.Ω(objs[1].Name).Should(gomega.Equal("quota2")) }) }) - Context("fetching space summary", func() { - It("no error occurs", func() { + ginkgo.Context("fetching space summary", func() { + ginkgo.It("no error occurs", func() { server.AppendHandlers( ghttp.CombineHandlers( ghttp.VerifyRequest("GET", "/v2/spaces/space-guid/summary"), @@ -225,18 +225,18 @@ var _ = Describe("Extensions", func() { ), ) objs, err := target.GetSpaceSummary("space-guid") - Ω(err).ShouldNot(HaveOccurred()) - Ω(objs.GUID).Should(Equal("space-guid")) - Ω(objs.Apps).Should(HaveLen(2)) - Ω(objs.Apps[0].GUID).Should(Equal("app1-guid")) - Ω(objs.Apps[0].RunningInstances).Should(Equal(1)) - Ω(objs.Apps[1].GUID).Should(Equal("app2-guid")) - Ω(objs.Apps[1].RunningInstances).Should(Equal(2)) + gomega.Ω(err).ShouldNot(gomega.HaveOccurred()) + gomega.Ω(objs.GUID).Should(gomega.Equal("space-guid")) + gomega.Ω(objs.Apps).Should(gomega.HaveLen(2)) + gomega.Ω(objs.Apps[0].GUID).Should(gomega.Equal("app1-guid")) + gomega.Ω(objs.Apps[0].RunningInstances).Should(gomega.Equal(1)) + gomega.Ω(objs.Apps[1].GUID).Should(gomega.Equal("app2-guid")) + gomega.Ω(objs.Apps[1].RunningInstances).Should(gomega.Equal(2)) }) }) - Context("fetching app events", func() { - It("no error occurs", func() { + ginkgo.Context("fetching app events", func() { + ginkgo.It("no error occurs", func() { now := time.Now() before := now.Add(-10 * time.Minute) server.AppendHandlers( @@ -291,32 +291,32 @@ var _ = Describe("Extensions", func() { ), ) objs, err := target.GetEvents() - Ω(err).ShouldNot(HaveOccurred()) - Ω(objs).Should(HaveLen(2)) - Ω(objs[0].GUID).Should(Equal("event1-guid")) - Ω(objs[0].CreatedAt).Should(BeTemporally("==", before)) - Ω(objs[0].UpdatedAt).Should(BeTemporally("==", now)) - Ω(objs[0].Type).Should(Equal("event1-type")) - Ω(objs[0].Actor.GUID).Should(Equal("event1-actor-guid")) - Ω(objs[0].Actor.Type).Should(Equal("event1-actor-type")) - Ω(objs[0].Actor.Name).Should(Equal("event1-actor-name")) - Ω(objs[0].Target.GUID).Should(Equal("event1-target-guid")) - Ω(objs[0].Target.Type).Should(Equal("event1-target-type")) - Ω(objs[0].Target.Name).Should(Equal("event1-target-name")) - Ω(objs[0].Space.GUID).Should(Equal("event1-space-guid")) - Ω(objs[0].Org.GUID).Should(Equal("event1-org-guid")) - Ω(objs[1].GUID).Should(Equal("event2-guid")) - Ω(objs[1].CreatedAt).Should(BeTemporally("==", before)) - Ω(objs[1].UpdatedAt).Should(BeTemporally("==", now)) - Ω(objs[1].Type).Should(Equal("event2-type")) - Ω(objs[1].Actor.GUID).Should(Equal("event2-actor-guid")) - Ω(objs[1].Actor.Type).Should(Equal("event2-actor-type")) - Ω(objs[1].Actor.Name).Should(Equal("event2-actor-name")) - Ω(objs[1].Target.GUID).Should(Equal("event2-target-guid")) - Ω(objs[1].Target.Type).Should(Equal("event2-target-type")) - Ω(objs[1].Target.Name).Should(Equal("event2-target-name")) - Ω(objs[1].Space.GUID).Should(Equal("event2-space-guid")) - Ω(objs[1].Org.GUID).Should(Equal("event2-org-guid")) + gomega.Ω(err).ShouldNot(gomega.HaveOccurred()) + gomega.Ω(objs).Should(gomega.HaveLen(2)) + gomega.Ω(objs[0].GUID).Should(gomega.Equal("event1-guid")) + gomega.Ω(objs[0].CreatedAt).Should(gomega.BeTemporally("==", before)) + gomega.Ω(objs[0].UpdatedAt).Should(gomega.BeTemporally("==", now)) + gomega.Ω(objs[0].Type).Should(gomega.Equal("event1-type")) + gomega.Ω(objs[0].Actor.GUID).Should(gomega.Equal("event1-actor-guid")) + gomega.Ω(objs[0].Actor.Type).Should(gomega.Equal("event1-actor-type")) + gomega.Ω(objs[0].Actor.Name).Should(gomega.Equal("event1-actor-name")) + gomega.Ω(objs[0].Target.GUID).Should(gomega.Equal("event1-target-guid")) + gomega.Ω(objs[0].Target.Type).Should(gomega.Equal("event1-target-type")) + gomega.Ω(objs[0].Target.Name).Should(gomega.Equal("event1-target-name")) + gomega.Ω(objs[0].Space.GUID).Should(gomega.Equal("event1-space-guid")) + gomega.Ω(objs[0].Org.GUID).Should(gomega.Equal("event1-org-guid")) + gomega.Ω(objs[1].GUID).Should(gomega.Equal("event2-guid")) + gomega.Ω(objs[1].CreatedAt).Should(gomega.BeTemporally("==", before)) + gomega.Ω(objs[1].UpdatedAt).Should(gomega.BeTemporally("==", now)) + gomega.Ω(objs[1].Type).Should(gomega.Equal("event2-type")) + gomega.Ω(objs[1].Actor.GUID).Should(gomega.Equal("event2-actor-guid")) + gomega.Ω(objs[1].Actor.Type).Should(gomega.Equal("event2-actor-type")) + gomega.Ω(objs[1].Actor.Name).Should(gomega.Equal("event2-actor-name")) + gomega.Ω(objs[1].Target.GUID).Should(gomega.Equal("event2-target-guid")) + gomega.Ω(objs[1].Target.Type).Should(gomega.Equal("event2-target-type")) + gomega.Ω(objs[1].Target.Name).Should(gomega.Equal("event2-target-name")) + gomega.Ω(objs[1].Space.GUID).Should(gomega.Equal("event2-space-guid")) + gomega.Ω(objs[1].Org.GUID).Should(gomega.Equal("event2-org-guid")) }) }) }) diff --git a/fetcher/updater_suite_test.go b/fetcher/updater_suite_test.go index 8241935b..9f69814d 100644 --- a/fetcher/updater_suite_test.go +++ b/fetcher/updater_suite_test.go @@ -3,11 +3,11 @@ package fetcher import ( "testing" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" + "github.com/onsi/ginkgo" + "github.com/onsi/gomega" ) func TestUpdater(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Updater Suite") + gomega.RegisterFailHandler(ginkgo.Fail) + ginkgo.RunSpecs(t, "Updater Suite") } diff --git a/filters/filters_suite_test.go b/filters/filters_suite_test.go index 2ce49f80..17f5758b 100644 --- a/filters/filters_suite_test.go +++ b/filters/filters_suite_test.go @@ -3,11 +3,11 @@ package filters_test import ( "testing" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" + "github.com/onsi/ginkgo" + "github.com/onsi/gomega" ) func TestFilters(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Filters Suite") + gomega.RegisterFailHandler(ginkgo.Fail) + ginkgo.RunSpecs(t, "Filters Suite") } diff --git a/filters/filters_test.go b/filters/filters_test.go index db0ded93..26b2a276 100644 --- a/filters/filters_test.go +++ b/filters/filters_test.go @@ -1,87 +1,87 @@ package filters_test import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" + "github.com/onsi/ginkgo" + "github.com/onsi/gomega" "github.com/bosh-prometheus/cf_exporter/filters" ) -var _ = Describe("Filters", func() { +var _ = ginkgo.Describe("Filters", func() { - Describe("Constructing Filters", func() { + ginkgo.Describe("Constructing Filters", func() { var ( err error f *filters.Filter ) - Context("with no active filters", func() { - BeforeEach(func() { + ginkgo.Context("with no active filters", func() { + ginkgo.BeforeEach(func() { f, err = filters.NewFilter() }) - It("no error occurs", func() { - Expect(err).To(BeNil()) + ginkgo.It("no error occurs", func() { + gomega.Expect(err).To(gomega.BeNil()) }) - It("all but events are active", func() { - Expect(f.Enabled(filters.Applications)).To(BeTrue()) - Expect(f.Enabled(filters.Buildpacks)).To(BeTrue()) - Expect(f.Enabled(filters.IsolationSegments)).To(BeTrue()) - Expect(f.Enabled(filters.Organizations)).To(BeTrue()) - Expect(f.Enabled(filters.Routes)).To(BeTrue()) - Expect(f.Enabled(filters.SecurityGroups)).To(BeTrue()) - Expect(f.Enabled(filters.ServiceBindings)).To(BeTrue()) - Expect(f.Enabled(filters.ServicePlans)).To(BeTrue()) - Expect(f.Enabled(filters.Services)).To(BeTrue()) - Expect(f.Enabled(filters.Spaces)).To(BeTrue()) - Expect(f.Enabled(filters.Stacks)).To(BeTrue()) - Expect(f.Enabled(filters.Tasks)).To(BeFalse()) - Expect(f.Enabled(filters.Events)).To(BeFalse()) + ginkgo.It("all but events are active", func() { + gomega.Expect(f.Enabled(filters.Applications)).To(gomega.BeTrue()) + gomega.Expect(f.Enabled(filters.Buildpacks)).To(gomega.BeTrue()) + gomega.Expect(f.Enabled(filters.IsolationSegments)).To(gomega.BeTrue()) + gomega.Expect(f.Enabled(filters.Organizations)).To(gomega.BeTrue()) + gomega.Expect(f.Enabled(filters.Routes)).To(gomega.BeTrue()) + gomega.Expect(f.Enabled(filters.SecurityGroups)).To(gomega.BeTrue()) + gomega.Expect(f.Enabled(filters.ServiceBindings)).To(gomega.BeTrue()) + gomega.Expect(f.Enabled(filters.ServicePlans)).To(gomega.BeTrue()) + gomega.Expect(f.Enabled(filters.Services)).To(gomega.BeTrue()) + gomega.Expect(f.Enabled(filters.Spaces)).To(gomega.BeTrue()) + gomega.Expect(f.Enabled(filters.Stacks)).To(gomega.BeTrue()) + gomega.Expect(f.Enabled(filters.Tasks)).To(gomega.BeFalse()) + gomega.Expect(f.Enabled(filters.Events)).To(gomega.BeFalse()) }) }) - Context("with valid active filters", func() { - BeforeEach(func() { + ginkgo.Context("with valid active filters", func() { + ginkgo.BeforeEach(func() { f, err = filters.NewFilter(filters.Applications, filters.Stacks) }) - It("no error occurs", func() { - Expect(err).To(BeNil()) + ginkgo.It("no error occurs", func() { + gomega.Expect(err).To(gomega.BeNil()) }) - It("only given filters are active", func() { - Expect(f.Enabled(filters.Applications)).To(BeTrue()) - Expect(f.Enabled(filters.Buildpacks)).To(BeFalse()) - Expect(f.Enabled(filters.IsolationSegments)).To(BeFalse()) - Expect(f.Enabled(filters.Organizations)).To(BeFalse()) - Expect(f.Enabled(filters.Routes)).To(BeFalse()) - Expect(f.Enabled(filters.SecurityGroups)).To(BeFalse()) - Expect(f.Enabled(filters.ServiceBindings)).To(BeFalse()) - Expect(f.Enabled(filters.ServicePlans)).To(BeFalse()) - Expect(f.Enabled(filters.Services)).To(BeFalse()) - Expect(f.Enabled(filters.Spaces)).To(BeFalse()) - Expect(f.Enabled(filters.Stacks)).To(BeTrue()) - Expect(f.Enabled(filters.Tasks)).To(BeFalse()) - Expect(f.Enabled(filters.Events)).To(BeFalse()) + ginkgo.It("only given filters are active", func() { + gomega.Expect(f.Enabled(filters.Applications)).To(gomega.BeTrue()) + gomega.Expect(f.Enabled(filters.Buildpacks)).To(gomega.BeFalse()) + gomega.Expect(f.Enabled(filters.IsolationSegments)).To(gomega.BeFalse()) + gomega.Expect(f.Enabled(filters.Organizations)).To(gomega.BeFalse()) + gomega.Expect(f.Enabled(filters.Routes)).To(gomega.BeFalse()) + gomega.Expect(f.Enabled(filters.SecurityGroups)).To(gomega.BeFalse()) + gomega.Expect(f.Enabled(filters.ServiceBindings)).To(gomega.BeFalse()) + gomega.Expect(f.Enabled(filters.ServicePlans)).To(gomega.BeFalse()) + gomega.Expect(f.Enabled(filters.Services)).To(gomega.BeFalse()) + gomega.Expect(f.Enabled(filters.Spaces)).To(gomega.BeFalse()) + gomega.Expect(f.Enabled(filters.Stacks)).To(gomega.BeTrue()) + gomega.Expect(f.Enabled(filters.Tasks)).To(gomega.BeFalse()) + gomega.Expect(f.Enabled(filters.Events)).To(gomega.BeFalse()) }) - It("querying all", func() { - Expect(f.All(filters.Applications, filters.Stacks)).To(BeTrue()) - Expect(f.All(filters.Applications, filters.Spaces)).To(BeFalse()) - Expect(f.All()).To(BeTrue()) + ginkgo.It("querying all", func() { + gomega.Expect(f.All(filters.Applications, filters.Stacks)).To(gomega.BeTrue()) + gomega.Expect(f.All(filters.Applications, filters.Spaces)).To(gomega.BeFalse()) + gomega.Expect(f.All()).To(gomega.BeTrue()) }) - It("querying any", func() { - Expect(f.Any(filters.Applications, filters.Stacks)).To(BeTrue()) - Expect(f.Any(filters.Applications, filters.Spaces)).To(BeTrue()) - Expect(f.Any(filters.Organizations, filters.Spaces)).To(BeFalse()) - Expect(f.Any()).To(BeFalse()) + ginkgo.It("querying any", func() { + gomega.Expect(f.Any(filters.Applications, filters.Stacks)).To(gomega.BeTrue()) + gomega.Expect(f.Any(filters.Applications, filters.Spaces)).To(gomega.BeTrue()) + gomega.Expect(f.Any(filters.Organizations, filters.Spaces)).To(gomega.BeFalse()) + gomega.Expect(f.Any()).To(gomega.BeFalse()) }) }) - Context("with invalid filters", func() { - BeforeEach(func() { + ginkgo.Context("with invalid filters", func() { + ginkgo.BeforeEach(func() { f, err = filters.NewFilter("I don't exist") }) - It("an error occurs", func() { - Expect(err).NotTo(BeNil()) + ginkgo.It("an error occurs", func() { + gomega.Expect(err).NotTo(gomega.BeNil()) }) })