Add cmd follow test

This commit is contained in:
178inaba 2017-04-24 01:13:08 +09:00
parent 7a4a84f70f
commit 6f6070b22e
2 changed files with 45 additions and 5 deletions

View file

@ -9,7 +9,7 @@ import (
"github.com/urfave/cli"
)
func testWithServer(h http.HandlerFunc, testFunc func(*cli.App)) string {
func testWithServer(h http.HandlerFunc, testFuncs ...func(*cli.App)) string {
ts := httptest.NewServer(h)
defer ts.Close()
@ -31,6 +31,10 @@ func testWithServer(h http.HandlerFunc, testFunc func(*cli.App)) string {
Server: "https://example.com",
},
}
testFunc(app)
for _, f := range testFuncs {
f(app)
}
return buf.String()
}