Skip to content

Commit

Permalink
update sqlite3 adapter tests to accept error messages from v3.46.0
Browse files Browse the repository at this point in the history
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
  • Loading branch information
flavorjones committed May 23, 2024
1 parent 95a6729 commit b2660d6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ def test_strict_strings_by_default
error = assert_raises(StandardError) do
conn.add_index :testings, :non_existent2
end
assert_match(/no such column: non_existent2/, error.message)
assert_match(/no such column: "?non_existent2"?/, error.message)
assert_equal conn.pool, error.connection_pool
end
end
Expand All @@ -1013,7 +1013,7 @@ def test_strict_strings_by_default_and_true_in_database_yml
error = assert_raises(StandardError) do
conn.add_index :testings, :non_existent
end
assert_match(/no such column: non_existent/, error.message)
assert_match(/no such column: "?non_existent"?/, error.message)
assert_equal conn.pool, error.connection_pool

with_strict_strings_by_default do
Expand All @@ -1023,7 +1023,7 @@ def test_strict_strings_by_default_and_true_in_database_yml
error = assert_raises(StandardError) do
conn.add_index :testings, :non_existent2
end
assert_match(/no such column: non_existent2/, error.message)
assert_match(/no such column: "?non_existent2"?/, error.message)
assert_equal conn.pool, error.connection_pool
end
end
Expand Down

0 comments on commit b2660d6

Please sign in to comment.