Skip to content

Commit

Permalink
add new unit test to ensure that groups as my-example will be allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
camilamacedo86 committed Oct 5, 2019
1 parent 1ef5f94 commit 8c64e50
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/scaffold/v1/resource/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ var _ = Describe("Resource", func() {
Expect(instance.Resource).To(Equal("cats"))
})

It("should allow hyphens in group names", func() {
instance := &resource.Resource{Group: "my-project", Kind: "Cat", Version: "v1"}
Expect(instance.Validate()).To(Succeed())
Expect(instance.GroupImportSafe).To(Equal("myproject"))
})

It("should keep the Resource if specified", func() {
instance := &resource.Resource{Group: "crew", Kind: "FirstMate", Version: "v1", Resource: "myresource"}
Expect(instance.Validate()).To(Succeed())
Expand Down

0 comments on commit 8c64e50

Please sign in to comment.