diff --git a/builder.go b/builder.go index 8dfbf17..8d2fe85 100644 --- a/builder.go +++ b/builder.go @@ -12,8 +12,9 @@ import ( ) var runnerTemplate = template.Must(template.New("main").Parse(`package {{ .Name }} + import ( -{{ if ne .Name "godog" }} "github.com/DATA-DOG/godog"{{ end }} + {{ if ne .Name "godog" }}"github.com/DATA-DOG/godog"{{ end }} "os" "testing" ) @@ -22,9 +23,7 @@ const GodogSuiteName = "{{ .Name }}" func TestMain(m *testing.M) { status := {{ if ne .Name "godog" }}godog.{{ end }}Run(func (suite *{{ if ne .Name "godog" }}godog.{{ end }}Suite) { - {{range .Contexts}} - {{ . }}(suite) - {{end}} + {{range .Contexts}}{{ . }}(suite){{end}} }) os.Exit(status) }`)) @@ -71,7 +70,11 @@ func buildTestPackage(pkg *build.Package, dir string) error { return err } - contexts, err := processPackageTestFiles(dir, pkg.TestGoFiles, pkg.XTestGoFiles) + contexts, err := processPackageTestFiles( + dir, + pkg.TestGoFiles, + pkg.XTestGoFiles, + ) if err != nil { return err } diff --git a/flags.go b/flags.go index 5560ebe..adc77da 100644 --- a/flags.go +++ b/flags.go @@ -32,16 +32,16 @@ func usage() { // --- GENERAL --- fmt.Println(cl("Usage:", yellow)) - fmt.Println(s(2) + "godog [options] []\n") + fmt.Println(s(2) + "godog [options] []\n") // --- ARGUMENTS --- fmt.Println(cl("Arguments:", yellow)) // --> paths - fmt.Println(opt("paths", "Optional path(s) to execute. Can be:")) + fmt.Println(opt("features", "Optional feature(s) to run. Can be:")) fmt.Println(opt("", s(4)+"- dir "+cl("(features/)", yellow))) fmt.Println(opt("", s(4)+"- feature "+cl("(*.feature)", yellow))) fmt.Println(opt("", s(4)+"- scenario at specific line "+cl("(*.feature:10)", yellow))) - fmt.Println(opt("", "If no paths are listed, suite tries "+cl("features", yellow)+" path by default.")) + fmt.Println(opt("", "If no feature paths are listed, suite tries "+cl("features", yellow)+" path by default.")) fmt.Println("") // --- OPTIONS ---