fix: rename openTestDB to openMigrationTestDB to avoid redeclaration with job_queue_test.go
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
func openTestDB(t *testing.T) *sql.DB {
|
||||
func openMigrationTestDB(t *testing.T) *sql.DB {
|
||||
t.Helper()
|
||||
db, err := sql.Open("sqlite3", ":memory:")
|
||||
if err != nil {
|
||||
@@ -28,7 +28,7 @@ func writeMigrationFile(t *testing.T, dir, filename, content string) {
|
||||
|
||||
func TestMigrationUp(t *testing.T) {
|
||||
t.Run("base de datos vacia aplica todas las migraciones", func(t *testing.T) {
|
||||
db := openTestDB(t)
|
||||
db := openMigrationTestDB(t)
|
||||
dir := t.TempDir()
|
||||
|
||||
writeMigrationFile(t, dir, "001_create_users.sql",
|
||||
@@ -58,7 +58,7 @@ func TestMigrationUp(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("migraciones ya aplicadas se omiten", func(t *testing.T) {
|
||||
db := openTestDB(t)
|
||||
db := openMigrationTestDB(t)
|
||||
dir := t.TempDir()
|
||||
|
||||
writeMigrationFile(t, dir, "001_create_users.sql",
|
||||
@@ -83,7 +83,7 @@ func TestMigrationUp(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("migracion con SQL invalido retorna error y deja las anteriores aplicadas", func(t *testing.T) {
|
||||
db := openTestDB(t)
|
||||
db := openMigrationTestDB(t)
|
||||
dir := t.TempDir()
|
||||
|
||||
writeMigrationFile(t, dir, "001_create_users.sql",
|
||||
@@ -108,7 +108,7 @@ func TestMigrationUp(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("directorio sin archivos sql no aplica nada", func(t *testing.T) {
|
||||
db := openTestDB(t)
|
||||
db := openMigrationTestDB(t)
|
||||
dir := t.TempDir()
|
||||
|
||||
applied, err := MigrationUp(db, dir)
|
||||
|
||||
Reference in New Issue
Block a user