Skip to content

Commit

Permalink
Small code improvement on test
Browse files Browse the repository at this point in the history
  • Loading branch information
andreynering committed Sep 8, 2018
1 parent b4861d6 commit ee16625
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions testfixtures_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,12 @@ func TestDetectTestDatabase(t *testing.T) {
{"ТESТ", false}, // cyrillic T
}

var (
mockedHelper *MockHelper
c *Context
err error
)

for _, it := range tests {
mockedHelper = NewMockHelper(it.name)
c = &Context{db: nil, helper: mockedHelper, fixturesFiles: nil}
err = c.DetectTestDatabase()
var (
mockedHelper = NewMockHelper(it.name)
c = &Context{db: nil, helper: mockedHelper, fixturesFiles: nil}
err = c.DetectTestDatabase()
)
if err != nil && it.isTestDatabase {
t.Errorf("DetectTestDatabase() should return nil for name = %s", it.name)
}
Expand Down

0 comments on commit ee16625

Please sign in to comment.