Skip to content

Commit 8c64e50

Browse files
add new unit test to ensure that groups as my-example will be allowed
1 parent 1ef5f94 commit 8c64e50

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/scaffold/v1/resource/resource_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ var _ = Describe("Resource", func() {
119119
Expect(instance.Resource).To(Equal("cats"))
120120
})
121121

122+
It("should allow hyphens in group names", func() {
123+
instance := &resource.Resource{Group: "my-project", Kind: "Cat", Version: "v1"}
124+
Expect(instance.Validate()).To(Succeed())
125+
Expect(instance.GroupImportSafe).To(Equal("myproject"))
126+
})
127+
122128
It("should keep the Resource if specified", func() {
123129
instance := &resource.Resource{Group: "crew", Kind: "FirstMate", Version: "v1", Resource: "myresource"}
124130
Expect(instance.Validate()).To(Succeed())

0 commit comments

Comments
 (0)