BeforeEach(func() { data = metadata.Metadata{ Release: &metadata.Release{ Version: "1.0.0", ReleaseType: "All In One", EULASlug: "some-other-eula", }, ProductFiles: []metadata.ProductFile{ {File: "hello.txt", Description: "available"}, }, } }) Context("when release is missing", func() { BeforeEach(func() { data.Release = nil }) It("returns an error", func() { Expect(data.Validate()).To(MatchError(fmt.Sprintf("missing required value %q", "release"))) }) }) Context("when eula slug is missing", func() { BeforeEach(func() { data.Release.EULASlug = "" }) It("returns an error", func() { Expect(data.Validate()).To(MatchError(fmt.Sprintf("missing required value %q", "eula_slug"))) })