mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Merge pull request #3058 from arunagw/jruby_query_cache_test
Fixed test for JRuby.
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user