From 06dc8ed28900246436003bf32dc2579af12f4846 Mon Sep 17 00:00:00 2001 From: Ralph Shnelvar Date: Sat, 25 Feb 2012 15:35:29 -0700 Subject: Fixing Windows asset tag helper test failure In asset_tag_helper_test.rb there is an assert on the number of bytes in a concatenated file. This test failed because Windows converts \n to \r\n as the default for "w". This is different than in *nix systems where there is no conversion done. THe test that failed was test_caching_stylesheet_link_tag_when_caching_on Using bin mode fixes this behavior on windows and makes no change on the *nix systems. --- activesupport/lib/active_support/core_ext/file/atomic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activesupport/lib/active_support/core_ext/file/atomic.rb b/activesupport/lib/active_support/core_ext/file/atomic.rb index 3645597301..fd1633ff45 100644 --- a/activesupport/lib/active_support/core_ext/file/atomic.rb +++ b/activesupport/lib/active_support/core_ext/file/atomic.rb @@ -16,7 +16,7 @@ class File require 'tempfile' unless defined?(Tempfile) require 'fileutils' unless defined?(FileUtils) - temp_file = Tempfile.new(basename(file_name), temp_dir) + temp_file = Tempfile.new(basename(file_name), temp_dir, :binmode => true) yield temp_file temp_file.close -- cgit v1.2.3