Skip to content

Commit

Permalink
Fix for new unique constraint message of SQLite 3.8.2 in test
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef Stribny committed Dec 12, 2013
1 parent 2070182 commit d860ce2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/test_statement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ def test_insert_duplicate_records
stmt.execute('ruby')

exception = assert_raises(SQLite3::ConstraintException) { stmt.execute('ruby') }
assert_match /column(s)? .* (is|are) not unique/, exception.message
# SQLite 3.8.2 returns new error message:
# UNIQUE constraint failed: *table_name*.*column_name*
# Older versions of SQLite return:
# column *column_name* is not unique
assert_match /(column(s)? .* (is|are) not unique|UNIQUE constraint failed: .*)/, exception.message
end

###
Expand Down

0 comments on commit d860ce2

Please sign in to comment.