Skip to content

Commit 1a2baa3

Browse files
committed
review: address feedback
1 parent 92cea86 commit 1a2baa3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pkg/db/migration_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package db
22

33
import (
44
"database/sql"
5+
"fmt"
56
"io/fs"
67
"os"
78
"path/filepath"
@@ -162,11 +163,9 @@ func TestDatabaseAheadOfMigrationFiles(t *testing.T) {
162163
)
163164
require.Error(t, err, "should error when database is ahead of migration files")
164165

165-
// Verify error message is descriptive
166-
assert.Contains(t, err.Error(), "database version 3", "should mention current database version")
167-
assert.Contains(t, err.Error(), "ahead of the current application version", "should clearly state the problem")
168-
assert.Contains(t, err.Error(), dbFile, "should include database file path")
169-
assert.Contains(t, err.Error(), "upgrade to the latest version", "should suggest upgrade")
166+
// Verify error message is correct
167+
expectedErr := fmt.Sprintf("database version 3 (%s) is ahead of the current application version. Please upgrade to the latest version", dbFile)
168+
assert.EqualError(t, err, expectedErr)
170169

171170
// Verify database version stayed at 3 (no changes were made)
172171
versionAfter := getDatabaseVersion(t, dbFile)

0 commit comments

Comments
 (0)