Skip to content
This repository
Browse code

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...
commit 06dc8ed28900246436003bf32dc2579af12f4846 1 parent b229bc7
RalphShnelvar authored
2  activesupport/lib/active_support/core_ext/file/atomic.rb
@@ -16,7 +16,7 @@ def self.atomic_write(file_name, temp_dir = Dir.tmpdir)
16 16
     require 'tempfile' unless defined?(Tempfile)
17 17
     require 'fileutils' unless defined?(FileUtils)
18 18
-    temp_file =, temp_dir)
+    temp_file =, temp_dir, :binmode => true)
20 20
     yield temp_file
21 21
22 22

0 notes on commit 06dc8ed

Please sign in to comment.
Something went wrong with that request. Please try again.