diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-03-03 00:03:05 -0300 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2012-03-04 16:35:35 +0100 |
commit | 864d755177d6cb9c46a64c6d55e7c48122f1d453 (patch) | |
tree | 7ae14338b28d76ed66d46b6715d6bd58c04168c1 /activerecord/test/cases/adapters/sqlite3 | |
parent | f6d478adcd3d2b28760e6e8b7ca5c1fd8abbc8a0 (diff) | |
download | rails-864d755177d6cb9c46a64c6d55e7c48122f1d453.tar.gz rails-864d755177d6cb9c46a64c6d55e7c48122f1d453.tar.bz2 rails-864d755177d6cb9c46a64c6d55e7c48122f1d453.zip |
Only run binary type cast test with encode! on Ruby 1.9
Diffstat (limited to 'activerecord/test/cases/adapters/sqlite3')
-rw-r--r-- | activerecord/test/cases/adapters/sqlite3/quoting_test.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/activerecord/test/cases/adapters/sqlite3/quoting_test.rb b/activerecord/test/cases/adapters/sqlite3/quoting_test.rb index a49b72ad49..377b60e348 100644 --- a/activerecord/test/cases/adapters/sqlite3/quoting_test.rb +++ b/activerecord/test/cases/adapters/sqlite3/quoting_test.rb @@ -13,12 +13,14 @@ module ActiveRecord :timeout => 100 end - def test_type_cast_binary_encoding_without_logger - @conn.extend(Module.new { def logger; end }) - column = Struct.new(:type, :name).new(:string, "foo") - binary = SecureRandom.hex - expected = binary.dup.encode!('utf-8') - assert_equal expected, @conn.type_cast(binary, column) + if "<3".encoding_aware? + def test_type_cast_binary_encoding_without_logger + @conn.extend(Module.new { def logger; end }) + column = Struct.new(:type, :name).new(:string, "foo") + binary = SecureRandom.hex + expected = binary.dup.encode!('utf-8') + assert_equal expected, @conn.type_cast(binary, column) + end end def test_type_cast_symbol |