Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/test_database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def test_extended_error_code
db.execute 'CREATE TABLE "employees" ("token" integer NOT NULL)'
begin
db.execute 'INSERT INTO employees (token) VALUES (NULL)'
rescue SQLite3::SQLException => e
rescue SQLite3::ConstraintException => e
end
assert_equal 1, e.code
assert_equal 1299, e.code
end

def test_bignum
Expand Down
2 changes: 1 addition & 1 deletion test/test_database_readonly.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_open_readonly_not_exists_database

def test_insert_readonly_database
@db = SQLite3::Database.new('test-readonly.db', :readonly => true)
assert_raise(SQLite3::SQLException) do
assert_raise(SQLite3::ReadOnlyException) do
@db.execute("INSERT INTO foos (id) VALUES (12)")
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/test_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def test_transaction_implicit_rollback
@db.transaction
@db.execute('create table bar (x CHECK(1 = 0))')
assert @db.transaction_active?
assert_raises( SQLite3::SQLException ) do
assert_raises( SQLite3::ConstraintException ) do
@db.execute("insert or rollback into bar (x) VALUES ('x')")
end
assert !@db.transaction_active?
Expand All @@ -485,7 +485,7 @@ def test_interrupt
func.result = x
end

assert_raise( SQLite3::SQLException ) do
assert_raise( SQLite3::InterruptException ) do
@db.execute "select abort(a) from foo"
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/test_statement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def test_double_close_does_not_segv
@db.execute 'CREATE TABLE "things" ("number" float NOT NULL)'

stmt = @db.prepare 'INSERT INTO things (number) VALUES (?)'
assert_raises(SQLite3::SQLException) { stmt.execute(nil) }
assert_raises(SQLite3::ConstraintException) { stmt.execute(nil) }

stmt.close

Expand All @@ -29,7 +29,7 @@ def test_insert_duplicate_records
stmt = @db.prepare("INSERT INTO things(name) VALUES(?)")
stmt.execute('ruby')

exception = assert_raises(SQLite3::SQLException) { stmt.execute('ruby') }
exception = assert_raises(SQLite3::ConstraintException) { stmt.execute('ruby') }
# SQLite 3.8.2 returns new error message:
# UNIQUE constraint failed: *table_name*.*column_name*
# Older versions of SQLite return:
Expand Down