Browse files

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.
  • Loading branch information...
1 parent b229bc7 commit 06dc8ed28900246436003bf32dc2579af12f4846 @RalphShnelvar RalphShnelvar committed Feb 25, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/core_ext/file/atomic.rb
@@ -16,7 +16,7 @@ def self.atomic_write(file_name, temp_dir = Dir.tmpdir)
require 'tempfile' unless defined?(Tempfile)
require 'fileutils' unless defined?(FileUtils)
- temp_file =, temp_dir)
+ temp_file =, temp_dir, :binmode => true)
yield temp_file

0 comments on commit 06dc8ed

Please sign in to comment.