예제 #1
0
// Setup API DSL roots.
func init() {
	design.Design = design.NewAPIDefinition()
	design.GeneratedMediaTypes = make(design.MediaTypeRoot)
	design.ProjectedMediaTypes = make(design.MediaTypeRoot)
	dslengine.Register(design.Design)
	dslengine.Register(design.GeneratedMediaTypes)
}
예제 #2
0
파일: runner.go 프로젝트: goadesign/gorma
func init() {
	gorma.GormaDesign = gorma.NewStorageGroupDefinition()
	dslengine.Register(gorma.GormaDesign)
}
예제 #3
0
// IterateSets implement Root
func (t *TestCD) IterateSets(it dslengine.SetIterator) {
	it([]dslengine.Definition{t})
}

// Reset is a no-op
func (t *TestCD) Reset() {}

var _ = Describe("ContainerDefinition", func() {
	var att *AttributeDefinition
	var testCD *TestCD
	BeforeEach(func() {
		dslengine.Reset()
		att = &AttributeDefinition{Type: Object{}}
		testCD = &TestCD{AttributeDefinition: att}
		dslengine.Register(testCD)
	})

	JustBeforeEach(func() {
		err := dslengine.Run()
		Ω(err).ShouldNot(HaveOccurred())
	})

	It("contains attributes", func() {
		Ω(testCD.Attribute()).Should(Equal(att))
	})
})

var _ = Describe("Attribute", func() {
	var name string
	var dataType interface{}