Skip to content

Commit

Permalink
Merge pull request #296 from cucumber/builder-test-lookover
Browse files Browse the repository at this point in the history
Moved builder tests to a godog_test pkg
  • Loading branch information
lonnblad authored May 22, 2020
2 parents 7568b29 + a1152ca commit abdd868
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion builder_go112_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// +build go1.12
// +build !go1.13

package godog
package godog_test

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion builder_go113_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// +build go1.13

package godog
package godog_test

import (
"bytes"
Expand Down
6 changes: 4 additions & 2 deletions builder_go_module_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package godog
package godog_test

import (
"bytes"
Expand All @@ -7,6 +7,8 @@ import (
"os/exec"
"path/filepath"
"testing"

"github.com/cucumber/godog"
)

func TestGodogBuildWithModuleOutsideGopathAndHavingOnlyFeature(t *testing.T) {
Expand Down Expand Up @@ -35,7 +37,7 @@ func TestGodogBuildWithModuleOutsideGopathAndHavingOnlyFeature(t *testing.T) {
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.Fatal(err)
}
Expand Down
6 changes: 4 additions & 2 deletions builder_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package godog
package godog_test

import (
"bytes"
Expand All @@ -9,6 +9,8 @@ import (
"path/filepath"
"strings"
"testing"

"github.com/cucumber/godog"
)

var builderFeatureFile = `Feature: eat godogs
Expand Down Expand Up @@ -137,7 +139,7 @@ func buildTestCommand(t *testing.T, args ...string) *exec.Cmd {
if build.Default.GOOS == "windows" {
bin += ".exe"
}
if err = Build(bin); err != nil {
if err = godog.Build(bin); err != nil {
t.Fatal(err)
}

Expand Down

0 comments on commit abdd868

Please sign in to comment.