aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-09-17 17:07:31 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2011-09-17 17:07:31 -0700
commit03346dfae704be94cbc5648180f59ab331c077d4 (patch)
treea6db901d17287960783f727413f56f0737722e1e
parent18116791d00d693643db3b4a99ae1d245c5a6c33 (diff)
parentafa78fe327e166a6aca10111a56101f74a6a6c8a (diff)
downloadrails-03346dfae704be94cbc5648180f59ab331c077d4.tar.gz
rails-03346dfae704be94cbc5648180f59ab331c077d4.tar.bz2
rails-03346dfae704be94cbc5648180f59ab331c077d4.zip
Merge pull request #3058 from arunagw/jruby_query_cache_test
Fixed test for JRuby.
-rw-r--r--activerecord/test/cases/query_cache_test.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/test/cases/query_cache_test.rb b/activerecord/test/cases/query_cache_test.rb
index e3ad0cad90..cda30a773e 100644
--- a/activerecord/test/cases/query_cache_test.rb
+++ b/activerecord/test/cases/query_cache_test.rb
@@ -148,12 +148,13 @@ class QueryCacheTest < ActiveRecord::TestCase
def test_cache_does_not_wrap_string_results_in_arrays
require 'sqlite3/version' if current_adapter?(:SQLite3Adapter)
+ sqlite3_version = RUBY_PLATFORM =~ /java/ ? Jdbc::SQLite3::VERSION : SQLite3::VERSION
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' || current_adapter?(:Mysql2Adapter) || current_adapter?(:MysqlAdapter)
+ elsif current_adapter?(:SQLite3Adapter) && sqlite3_version > '1.2.5' || current_adapter?(:Mysql2Adapter) || current_adapter?(:MysqlAdapter)
# Future versions of the sqlite3 adapter will return numeric
assert_instance_of Fixnum,
Task.connection.select_value("SELECT count(*) AS count_all FROM tasks")