Permalink
Browse files

Merge pull request #1400 from arunagw/query_cache_test

Query cache test
  • Loading branch information...
2 parents ce23c6e + fe99a81 commit 56f13a334118ea90bcfc90b23c1c8e318954eb9c @tenderlove tenderlove committed May 31, 2011
Showing with 9 additions and 2 deletions.
  1. +9 −2 activerecord/test/cases/query_cache_test.rb
@@ -51,16 +51,23 @@ def test_cache_is_flat
end
def test_cache_does_not_wrap_string_results_in_arrays
- require 'sqlite3/version' if current_adapter?(:SQLite3Adapter)
+ require 'sqlite3/version' if current_adapter?(:SQLite3Adapter) && !(RUBY_PLATFORM =~ /java/)
Task.cache do
# Oracle adapter returns count() as Fixnum or Float
if current_adapter?(:OracleAdapter)
assert_kind_of Numeric, Task.connection.select_value("SELECT count(*) AS count_all FROM tasks")
- elsif current_adapter?(:SQLite3Adapter) && SQLite3::VERSION > '1.2.5' or current_adapter?(:Mysql2Adapter)
+ elsif !(RUBY_PLATFORM =~ /java/) &&
+ ((current_adapter?(:SQLite3Adapter) && SQLite3::VERSION > '1.2.5') or
+ current_adapter?(:Mysql2Adapter))
# Future versions of the sqlite3 adapter will return numeric
assert_instance_of Fixnum,
Task.connection.select_value("SELECT count(*) AS count_all FROM tasks")
+ elsif (RUBY_PLATFORM =~ /java/) &&
+ ((current_adapter?(:SQLite3Adapter)) or
+ current_adapter?(:MysqlAdapter))
+ 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

0 comments on commit 56f13a3

Please sign in to comment.