Skip to content

Commit b2660d6

Browse files
committed
update sqlite3 adapter tests to accept error messages from v3.46.0
Upstream sqlite updated the error messages to be more descriptive starting in v3.46.0. Where the error message might look like this in earlier versions: no such column: non_existent in 3.46.0 it looks like: no such column: "non_existent" - should this be a string literal in single-quotes? The tests have been updated to accept either style of message. The sqlite3-ruby gem will release a version with this vendored version shortly, see sparklemotion/sqlite3-ruby#536
1 parent 95a6729 commit b2660d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ def test_strict_strings_by_default
10011001
error = assert_raises(StandardError) do
10021002
conn.add_index :testings, :non_existent2
10031003
end
1004-
assert_match(/no such column: non_existent2/, error.message)
1004+
assert_match(/no such column: "?non_existent2"?/, error.message)
10051005
assert_equal conn.pool, error.connection_pool
10061006
end
10071007
end
@@ -1013,7 +1013,7 @@ def test_strict_strings_by_default_and_true_in_database_yml
10131013
error = assert_raises(StandardError) do
10141014
conn.add_index :testings, :non_existent
10151015
end
1016-
assert_match(/no such column: non_existent/, error.message)
1016+
assert_match(/no such column: "?non_existent"?/, error.message)
10171017
assert_equal conn.pool, error.connection_pool
10181018

10191019
with_strict_strings_by_default do
@@ -1023,7 +1023,7 @@ def test_strict_strings_by_default_and_true_in_database_yml
10231023
error = assert_raises(StandardError) do
10241024
conn.add_index :testings, :non_existent2
10251025
end
1026-
assert_match(/no such column: non_existent2/, error.message)
1026+
assert_match(/no such column: "?non_existent2"?/, error.message)
10271027
assert_equal conn.pool, error.connection_pool
10281028
end
10291029
end

0 commit comments

Comments
 (0)