diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/binary_test.rb | 4 | ||||
-rwxr-xr-x | activerecord/test/cases/fixtures_test.rb | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/activerecord/test/cases/binary_test.rb b/activerecord/test/cases/binary_test.rb index 2effa5736f..7131532c05 100644 --- a/activerecord/test/cases/binary_test.rb +++ b/activerecord/test/cases/binary_test.rb @@ -17,7 +17,9 @@ unless current_adapter?(:SQLServerAdapter, :SybaseAdapter, :DB2Adapter, :Firebir Binary.delete_all FIXTURES.each do |filename| - data = File.read(ASSETS_ROOT + "/#{filename}").freeze + data = File.read(ASSETS_ROOT + "/#{filename}") + data.force_encoding('ASCII-8BIT') if data.respond_to?(:force_encoding) + data.freeze bin = Binary.new(:data => data) assert_equal data, bin.data, 'Newly assigned data differs from original' diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index bedb26f28d..182f4f0f0b 100755 --- a/activerecord/test/cases/fixtures_test.rb +++ b/activerecord/test/cases/fixtures_test.rb @@ -180,7 +180,9 @@ class FixturesTest < ActiveRecord::TestCase def test_binary_in_fixtures assert_equal 1, @binaries.size - data = File.open(ASSETS_ROOT + "/flowers.jpg", "rb").read.freeze + data = File.read(ASSETS_ROOT + "/flowers.jpg") + data.force_encoding('ASCII-8BIT') if data.respond_to?(:force_encoding) + data.freeze assert_equal data, @flowers.data end end |