Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit b454601be403bd58af4a93b459f98ff4e2d211ea 1 parent bcdc2c0
@fxn fxn authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/test/cases/adapters/sqlite3/explain_test.rb
View
6 activerecord/test/cases/adapters/sqlite3/explain_test.rb
@@ -9,13 +9,13 @@ class ExplainTest < ActiveRecord::TestCase
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
Please sign in to comment.
Something went wrong with that request. Please try again.