-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpart_test.go
More file actions
18 lines (15 loc) · 751 Bytes
/
part_test.go
File metadata and controls
18 lines (15 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package migrate
import "testing"
var pExpectError = newExpectError(func(args ...interface{}) error {
_, err := NewPart("testing/" + args[0].(string))
return err
})
// TestBadParts ensures that NewPart returns an appropriate error message with
// invalid part files.
func TestBadParts(t *testing.T) {
pExpectError(t, "blank migration files", "to begin with a comment denoting", "blank/version_1/test.sql")
pExpectError(t, "migration files containing no direction markers",
"to begin with a comment denoting", "bad_parts/no_markers.sql")
pExpectError(t, "no upward migration SQL", "no upward migration data", "bad_parts/no_upward.sql")
pExpectError(t, "no downward migration SQL", "no downward migration data", "bad_parts/no_downward.sql")
}