Skip to content

Commit

Permalink
Fix variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
wattmto committed Mar 1, 2023
1 parent 4ca15bd commit 3c8ad18
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions pkg/factory/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ var _ = Describe("Factory", func() {
DescribeTable("getting allocator",
func(policy string, shouldSucceed bool, expected reflect.Type) {
f := factory.NewResourceFactory("fake", "fake", true)
a, e := f.GetAllocator(policy)
allocator, error := f.GetAllocator(policy)

if shouldSucceed {
Expect(e).NotTo(HaveOccurred())
Expect(error).NotTo(HaveOccurred())
} else {
Expect(a).To(BeNil())
Expect(allocator).To(BeNil())
}

// if statement below because gomega refuses to do "nil == nil" assertions
if expected != nil {
Expect(reflect.TypeOf(a)).To(Equal(expected))
Expect(reflect.TypeOf(allocator)).To(Equal(expected))
} else {
Expect(reflect.TypeOf(a)).To(BeNil())
Expect(reflect.TypeOf(allocator)).To(BeNil())
}
},
Entry("packed", "packed", true, reflect.TypeOf(resources.NewPackedAllocator())),
Expand Down
8 changes: 4 additions & 4 deletions pkg/resources/allocator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ var _ = Describe("Allocator", func() {
Describe("creating new packed allocator", func() {
Context("with valid policy", func() {
It("should return valid allocator", func() {
pa := resources.NewPackedAllocator()
packedAllocator := resources.NewPackedAllocator()
expected := &resources.PackedAllocator{}
Expect(reflect.TypeOf(pa)).To(Equal(reflect.TypeOf(expected)))
Expect(reflect.TypeOf(packedAllocator)).To(Equal(reflect.TypeOf(expected)))
})
})
})
Describe("creating new allocator", func() {
Context("with default policy", func() {
It("should return valid allocator", func() {
a := resources.NewAllocator()
allocator := resources.NewAllocator()
expected := &resources.Allocator{}
Expect(reflect.TypeOf(a)).To(Equal(reflect.TypeOf(expected)))
Expect(reflect.TypeOf(allocator)).To(Equal(reflect.TypeOf(expected)))
})
})
})
Expand Down

0 comments on commit 3c8ad18

Please sign in to comment.