Permalink
Browse files

fixed test for JRuby.

for Sqlite3 in AR-JDBC.It's Jdbc::SQLite3::VERSION
  • Loading branch information...
arunagw committed Sep 18, 2011
1 parent 081d41a commit 2d4ac4fd560a599f68dd3e521bb2b098074913f3
Showing with 5 additions and 2 deletions.
  1. +5 −2 activerecord/test/cases/query_cache_test.rb
@@ -147,13 +147,16 @@ def test_cache_is_flat
end
def test_cache_does_not_wrap_string_results_in_arrays
- require 'sqlite3/version' if current_adapter?(:SQLite3Adapter)
+ if current_adapter?(:SQLite3Adapter)
+ require 'sqlite3/version'
+ sqlite3_version = RUBY_PLATFORM =~ /java/ ? Jdbc::SQLite3::VERSION : SQLite3::VERSION
+ end
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")

0 comments on commit 2d4ac4f

Please sign in to comment.