Moved builder tests to a godog_test pkg

Этот коммит содержится в:
Fredrik Lönnblad 2020-05-22 13:56:20 +02:00
родитель 7568b291e4
коммит a1152ca1c9
4 изменённых файлов: 10 добавлений и 6 удалений

Просмотреть файл

@ -1,7 +1,7 @@
// +build go1.12 // +build go1.12
// +build !go1.13 // +build !go1.13
package godog package godog_test
import ( import (
"bytes" "bytes"

Просмотреть файл

@ -1,6 +1,6 @@
// +build go1.13 // +build go1.13
package godog package godog_test
import ( import (
"bytes" "bytes"

Просмотреть файл

@ -1,4 +1,4 @@
package godog package godog_test
import ( import (
"bytes" "bytes"
@ -7,6 +7,8 @@ import (
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"testing" "testing"
"github.com/cucumber/godog"
) )
func TestGodogBuildWithModuleOutsideGopathAndHavingOnlyFeature(t *testing.T) { func TestGodogBuildWithModuleOutsideGopathAndHavingOnlyFeature(t *testing.T) {
@ -35,7 +37,7 @@ func TestGodogBuildWithModuleOutsideGopathAndHavingOnlyFeature(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
if out, err := exec.Command("go", "mod", "edit", "-require", fmt.Sprintf("github.com/cucumber/godog@%s", Version)).CombinedOutput(); err != nil { if out, err := exec.Command("go", "mod", "edit", "-require", fmt.Sprintf("github.com/cucumber/godog@%s", godog.Version)).CombinedOutput(); err != nil {
t.Log(string(out)) t.Log(string(out))
t.Fatal(err) t.Fatal(err)
} }

Просмотреть файл

@ -1,4 +1,4 @@
package godog package godog_test
import ( import (
"bytes" "bytes"
@ -9,6 +9,8 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"testing" "testing"
"github.com/cucumber/godog"
) )
var builderFeatureFile = `Feature: eat godogs var builderFeatureFile = `Feature: eat godogs
@ -137,7 +139,7 @@ func buildTestCommand(t *testing.T, args ...string) *exec.Cmd {
if build.Default.GOOS == "windows" { if build.Default.GOOS == "windows" {
bin += ".exe" bin += ".exe"
} }
if err = Build(bin); err != nil { if err = godog.Build(bin); err != nil {
t.Fatal(err) t.Fatal(err)
} }