Ensure MultiError returned when both Before and After funcs given

This commit is contained in:
Dan Buch
2016-04-28 17:15:16 -04:00
parent 61d4175525
commit 4cae17cfe1
3 changed files with 38 additions and 10 deletions

View File

@@ -154,9 +154,10 @@ func TestContext_GlobalFlag(t *testing.T) {
app.Flags = []Flag{
StringFlag{Name: "global, g", Usage: "global"},
}
app.Action = func(c *Context) {
app.Action = func(c *Context) error {
globalFlag = c.GlobalString("global")
globalFlagSet = c.GlobalIsSet("global")
return nil
}
app.Run([]string{"command", "-g", "foo"})
expect(t, globalFlag, "foo")