diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-03-02 10:25:00 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-03-02 10:28:06 -0800 |
commit | af022918716e894608d655cdb52ec3164fee597a (patch) | |
tree | 225100571841387ba06e8ec0caa9ff908dab7864 /activerecord/test/cases/adapters/sqlite3 | |
parent | 867482335067bcef7faae91a7eaa9e98bf94ac62 (diff) | |
download | rails-af022918716e894608d655cdb52ec3164fee597a.tar.gz rails-af022918716e894608d655cdb52ec3164fee597a.tar.bz2 rails-af022918716e894608d655cdb52ec3164fee597a.zip |
only log an error if there is a logger. fixes #5226
Conflicts:
activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
Diffstat (limited to 'activerecord/test/cases/adapters/sqlite3')
-rw-r--r-- | activerecord/test/cases/adapters/sqlite3/quoting_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/sqlite3/quoting_test.rb b/activerecord/test/cases/adapters/sqlite3/quoting_test.rb index e0152e7ccf..a49b72ad49 100644 --- a/activerecord/test/cases/adapters/sqlite3/quoting_test.rb +++ b/activerecord/test/cases/adapters/sqlite3/quoting_test.rb @@ -1,6 +1,7 @@ require "cases/helper" require 'bigdecimal' require 'yaml' +require 'securerandom' module ActiveRecord module ConnectionAdapters @@ -12,6 +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) + end + def test_type_cast_symbol assert_equal 'foo', @conn.type_cast(:foo, nil) end |