Improve vendoring options by removing self-referential imports in tests.

This commit is contained in:
Edward Sheffler III
2015-07-20 12:18:25 -07:00
committed by Edward Sheffler III
parent bca61c476e
commit 8ea1232ede
7 changed files with 319 additions and 331 deletions

View File

@@ -1,26 +1,24 @@
package cli_test
package cli
import (
"flag"
"testing"
"github.com/codegangsta/cli"
)
func TestCommandDoNotIgnoreFlags(t *testing.T) {
app := cli.NewApp()
app := NewApp()
set := flag.NewFlagSet("test", 0)
test := []string{"blah", "blah", "-break"}
set.Parse(test)
c := cli.NewContext(app, set, nil)
c := NewContext(app, set, nil)
command := cli.Command{
command := Command{
Name: "test-cmd",
Aliases: []string{"tc"},
Usage: "this is for testing",
Description: "testing",
Action: func(_ *cli.Context) {},
Action: func(_ *Context) {},
}
err := command.Run(c)
@@ -28,19 +26,19 @@ func TestCommandDoNotIgnoreFlags(t *testing.T) {
}
func TestCommandIgnoreFlags(t *testing.T) {
app := cli.NewApp()
app := NewApp()
set := flag.NewFlagSet("test", 0)
test := []string{"blah", "blah"}
set.Parse(test)
c := cli.NewContext(app, set, nil)
c := NewContext(app, set, nil)
command := cli.Command{
command := Command{
Name: "test-cmd",
Aliases: []string{"tc"},
Usage: "this is for testing",
Description: "testing",
Action: func(_ *cli.Context) {},
Action: func(_ *Context) {},
SkipFlagParsing: true,
}
err := command.Run(c)