Skip to content

Commit

Permalink
Move stubs to testdata directory
Browse files Browse the repository at this point in the history
  • Loading branch information
amacneil committed Aug 20, 2016
1 parent 7da72a3 commit d97ed2b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ import (
"testing"
)

var stubsDir string
var testdataDir string

func testContext(t *testing.T, u *url.URL) *cli.Context {
var err error
if stubsDir == "" {
stubsDir, err = filepath.Abs("./stubs")

// only chdir once, because testdata is relative to current directory
if testdataDir == "" {
testdataDir, err = filepath.Abs("./testdata")
require.Nil(t, err)
}

err = os.Chdir(stubsDir)
require.Nil(t, err)
err = os.Chdir(testdataDir)
require.Nil(t, err)
}

err = os.Setenv("DATABASE_URL", u.String())
require.Nil(t, err)
Expand Down

0 comments on commit d97ed2b

Please sign in to comment.