diff options
Diffstat (limited to 'activerecord/test/cases/query_cache_test.rb')
-rw-r--r-- | activerecord/test/cases/query_cache_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/query_cache_test.rb b/activerecord/test/cases/query_cache_test.rb index 2af6a56b6a..3710f8e40b 100644 --- a/activerecord/test/cases/query_cache_test.rb +++ b/activerecord/test/cases/query_cache_test.rb @@ -49,10 +49,16 @@ class QueryCacheTest < ActiveRecord::TestCase end def test_cache_does_not_wrap_string_results_in_arrays + require 'sqlite3/version' if current_adapter?(:SQLite3Adapter) + Task.cache do # Oracle adapter returns count() as Fixnum or Float if current_adapter?(:OracleAdapter) assert Task.connection.select_value("SELECT count(*) AS count_all FROM tasks").is_a?(Numeric) + elsif current_adapter?(:SQLite3Adapter) && SQLite3::Version::VERSION > '1.2.5' + # Future versions of the sqlite3 adapter will return numeric + assert_instance_of Fixnum, + Task.connection.select_value("SELECT count(*) AS count_all FROM tasks") else assert_instance_of String, Task.connection.select_value("SELECT count(*) AS count_all FROM tasks") end |