Skip to content

Commit

Permalink
Test the error reporing on broken migration reversal
Browse files Browse the repository at this point in the history
  • Loading branch information
gsamokovarov committed Sep 21, 2018
1 parent 6069fe9 commit 3bc77a6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,17 @@ func TestSQLExecutor_Down(t *testing.T) {
assert.NotNil(t, err)
})
}

func TestSQLExecutor_Down_Broken(t *testing.T) {
td := filepath.Join(dbSrc, "20180920181906_migration_with_an_error")

exe := NewSQLExecutor(db)

migration, err := MigrationFromBytes(td, ioutil.ReadFile)
assert.Nil(t, err)

cleanState(func() {
err := exe.Down(migration, new(testingStore))
assert.Error(t, err)
})
}

0 comments on commit 3bc77a6

Please sign in to comment.