Skip to content

Commit

Permalink
Only run binary type cast test with encode! on Ruby 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosantoniodasilva authored and drogus committed Mar 4, 2012
1 parent b1358c8 commit 24e074f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions activerecord/test/cases/adapters/sqlite3/quoting_test.rb
Expand Up @@ -13,12 +13,14 @@ def setup
: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
Expand Down

0 comments on commit 24e074f

Please sign in to comment.