Skip to content

Commit 0f1cd49

Browse files
committed
Fix name
1 parent 4848970 commit 0f1cd49

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

models/unittest/testdb.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ func fatalTestError(fmtStr string, args ...interface{}) {
4343
type TestOptions struct {
4444
GiteaRootPath string
4545
FixtureFiles []string
46-
TearUp func() error
47-
TearDown func() error
46+
SetUp func() error // SetUp will be executed before all tests in this package
47+
TearDown func() error // TearDown will be executed after all tests in this package
4848
}
4949

5050
// MainTest a reusable TestMain(..) function for unit tests that need to use a
@@ -137,9 +137,9 @@ func MainTest(m *testing.M, testOpts *TestOptions) {
137137
}
138138
}
139139

140-
if testOpts.TearUp != nil {
141-
if err := testOpts.TearUp(); err != nil {
142-
fatalTestError("tear up failed: %v\n", err)
140+
if testOpts.SetUp != nil {
141+
if err := testOpts.SetUp(); err != nil {
142+
fatalTestError("set up failed: %v\n", err)
143143
}
144144
}
145145

0 commit comments

Comments
 (0)