Skip to content

Commit

Permalink
Remove redundant tests, rename tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
danilvpetrov committed Jan 15, 2024
1 parent a45f852 commit 8671f61
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 94 deletions.
25 changes: 0 additions & 25 deletions static/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,31 +169,6 @@ var _ = Describe("func FromPackages() (application detection)", func() {
})
})

When("a handler with a non-pointer methodset is registered as a pointer", func() {
It("includes the handler in the application configuration", func() {
cfg := packages.Config{
Mode: packages.LoadAllSyntax,
Dir: "testdata/apps/pointer-handler-with-non-pointer-methodset",
}

pkgs := loadPackages(cfg)

apps := FromPackages(pkgs)
Expect(apps).To(HaveLen(1))
Expect(apps[0].Handlers().Aggregates()).To(HaveLen(1))

a := apps[0].Handlers().Aggregates()[0]
Expect(a.Identity()).To(
Equal(
configkit.Identity{
Name: "<aggregate>",
Key: "dad3b670-0852-4711-9efb-af25679734ee",
},
),
)
})
})

When("an application in the package has multiple handlers", func() {
It("returns all messages consumed or produced by all handlers", func() {
cfg := packages.Config{
Expand Down
14 changes: 7 additions & 7 deletions static/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,11 +856,11 @@ var _ = Describe("func FromPackages() (handler analysis)", func() {
})
})

When("the application contains handlers registered as pointers with method receivers passed by values", func() {
It("correctly returns configurations for such handlers", func() {
When("a handler with a non-pointer methodset is registered as a pointer", func() {
It("includes the handler in the application configuration", func() {
cfg := packages.Config{
Mode: packages.LoadAllSyntax,
Dir: "testdata/handlers/non-pointer-registered-as-pointer",
Dir: "testdata/handlers/pointer-handler-with-non-pointer-methodset",
}

pkgs := loadPackages(cfg)
Expand All @@ -883,7 +883,7 @@ var _ = Describe("func FromPackages() (handler analysis)", func() {
)
Expect(aggregate.TypeName()).To(
Equal(
"*github.com/dogmatiq/configkit/static/testdata/handlers/non-pointer-registered-as-pointer.AggregateHandler",
"*github.com/dogmatiq/configkit/static/testdata/handlers/pointer-handler-with-non-pointer-methodset.AggregateHandler",
),
)
Expect(aggregate.HandlerType()).To(Equal(configkit.AggregateHandlerType))
Expand Down Expand Up @@ -912,7 +912,7 @@ var _ = Describe("func FromPackages() (handler analysis)", func() {
)
Expect(process.TypeName()).To(
Equal(
"*github.com/dogmatiq/configkit/static/testdata/handlers/non-pointer-registered-as-pointer.ProcessHandler",
"*github.com/dogmatiq/configkit/static/testdata/handlers/pointer-handler-with-non-pointer-methodset.ProcessHandler",
),
)
Expect(process.HandlerType()).To(Equal(configkit.ProcessHandlerType))
Expand Down Expand Up @@ -945,7 +945,7 @@ var _ = Describe("func FromPackages() (handler analysis)", func() {
)
Expect(projection.TypeName()).To(
Equal(
"*github.com/dogmatiq/configkit/static/testdata/handlers/non-pointer-registered-as-pointer.ProjectionHandler",
"*github.com/dogmatiq/configkit/static/testdata/handlers/pointer-handler-with-non-pointer-methodset.ProjectionHandler",
),
)
Expect(projection.HandlerType()).To(Equal(configkit.ProjectionHandlerType))
Expand All @@ -971,7 +971,7 @@ var _ = Describe("func FromPackages() (handler analysis)", func() {
)
Expect(integration.TypeName()).To(
Equal(
"*github.com/dogmatiq/configkit/static/testdata/handlers/non-pointer-registered-as-pointer.IntegrationHandler",
"*github.com/dogmatiq/configkit/static/testdata/handlers/pointer-handler-with-non-pointer-methodset.IntegrationHandler",
),
)
Expect(integration.HandlerType()).To(Equal(configkit.IntegrationHandlerType))
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 8671f61

Please sign in to comment.