diff options
author | Xavier Noria <fxn@hashref.com> | 2011-11-06 22:21:05 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-11-06 22:21:05 -0800 |
commit | b454601be403bd58af4a93b459f98ff4e2d211ea (patch) | |
tree | 465d7bcada48e05676cac5ebe6342eb41ea90bf2 /activerecord/test/cases/adapters/sqlite3/explain_test.rb | |
parent | bcdc2c00d3d052c3aa5cb029b3cb66d2c56721ee (diff) | |
download | rails-b454601be403bd58af4a93b459f98ff4e2d211ea.tar.gz rails-b454601be403bd58af4a93b459f98ff4e2d211ea.tar.bz2 rails-b454601be403bd58af4a93b459f98ff4e2d211ea.zip |
revises EXPLAIN tests for SQLite3
The output in Travis is a bit different. The SQLite
documentation (http://www.sqlite.org/eqp.html) warns
output may change dramatically between releases. I
do not want to mock the result set because I want a
real EXPLAIN to happen. I prefer a test that may fail
in future releases than a test that may give false
positives in future releases.
Diffstat (limited to 'activerecord/test/cases/adapters/sqlite3/explain_test.rb')
-rw-r--r-- | activerecord/test/cases/adapters/sqlite3/explain_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/adapters/sqlite3/explain_test.rb b/activerecord/test/cases/adapters/sqlite3/explain_test.rb index 97be9f14e9..e18892821d 100644 --- a/activerecord/test/cases/adapters/sqlite3/explain_test.rb +++ b/activerecord/test/cases/adapters/sqlite3/explain_test.rb @@ -9,13 +9,13 @@ module ActiveRecord def test_explain_for_one_query explain = Developer.where(:id => 1).explain - assert_match %(SEARCH TABLE developers USING INTEGER PRIMARY KEY), explain + assert_match(/(SEARCH )?TABLE developers USING (INTEGER )?PRIMARY KEY/, explain) end def test_explain_with_eager_loading explain = Developer.where(:id => 1).includes(:audit_logs).explain - assert_match %(SEARCH TABLE developers USING INTEGER PRIMARY KEY), explain - assert_match %(SCAN TABLE audit_logs), explain + assert_match(/(SEARCH )?TABLE developers USING (INTEGER )?PRIMARY KEY/, explain) + assert_match(/(SCAN )?TABLE audit_logs/, explain) end end end |