diff --git a/_integration_tests/integration_test.go b/_integration_tests/integration_test.go index c461d343..c58ecd7b 100644 --- a/_integration_tests/integration_test.go +++ b/_integration_tests/integration_test.go @@ -120,6 +120,16 @@ type Multimedialist struct { } } +func TestIssue161(t *testing.T) { + defer cleanup("./issue161/*") + if err := goagen("./issue161", "bootstrap", "-d", "github.com/shogo82148/goa-v1/_integration_tests/issue161/design"); err != nil { + t.Error(err.Error()) + } + if err := gobuild("./issue161"); err != nil { + t.Error(err.Error()) + } +} + func goagen(dir, command string, args ...string) error { pkg, err := build.Import("github.com/shogo82148/goa-v1/goagen", "", 0) if err != nil { diff --git a/_integration_tests/issue161/design/design.go b/_integration_tests/issue161/design/design.go new file mode 100644 index 00000000..464b2e93 --- /dev/null +++ b/_integration_tests/issue161/design/design.go @@ -0,0 +1,23 @@ +package design + +import ( + . "github.com/shogo82148/goa-v1/design" + . "github.com/shogo82148/goa-v1/design/apidsl" +) + +var _ = API("media", func() { + Title("An API exercising the DefaultMedia definition") + Host("localhost:8080") + Scheme("http") +}) + +var Author = Type("Author", func() { + Attribute("name", String) + Attribute("country", String) + Required("name") +}) + +var Book = Type("Book", func() { + Attribute("title", String) + Attribute("author", Author) +})