Skip to content

Commit

Permalink
add test for #161
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo82148 committed Feb 21, 2022
1 parent 42d3d29 commit 98f954b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
10 changes: 10 additions & 0 deletions _integration_tests/integration_test.go
Expand Up @@ -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 {
Expand Down
23 changes: 23 additions & 0 deletions _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)
})

0 comments on commit 98f954b

Please sign in to comment.