Skip to content
This repository
Browse code

Merge pull request #6541 from tjouan/tj/activesupport-fix-tests-requi…

…ring-unsafe-umask

Make  tests pass with umask
  • Loading branch information...
commit d5025f15d8ec753ebc03597a0a28f0e05575454e 2 parents 61bb6c2 + 7b6bf02
Rafael Mendonça França authored May 30, 2012

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  activesupport/test/core_ext/file_test.rb
6  activesupport/test/core_ext/file_test.rb
@@ -30,7 +30,7 @@ def test_atomic_write_preserves_file_permissions
30 30
       assert File.exist?(file_name)
31 31
     end
32 32
     assert File.exist?(file_name)
33  
-    assert_equal 0100755, file_mode
  33
+    assert_equal 0100755 & ~File.umask, file_mode
34 34
     assert_equal contents, File.read(file_name)
35 35
 
36 36
     File.atomic_write(file_name, Dir.pwd) do |file|
@@ -38,7 +38,7 @@ def test_atomic_write_preserves_file_permissions
38 38
       assert File.exist?(file_name)
39 39
     end
40 40
     assert File.exist?(file_name)
41  
-    assert_equal 0100755, file_mode
  41
+    assert_equal 0100755 & ~File.umask, file_mode
42 42
     assert_equal contents, File.read(file_name)
43 43
   ensure
44 44
     File.unlink(file_name) rescue nil
@@ -51,7 +51,7 @@ def test_atomic_write_preserves_default_file_permissions
51 51
       assert !File.exist?(file_name)
52 52
     end
53 53
     assert File.exist?(file_name)
54  
-    assert_equal 0100666 ^ File.umask, file_mode
  54
+    assert_equal 0100666 & ~File.umask, file_mode
55 55
     assert_equal contents, File.read(file_name)
56 56
   ensure
57 57
     File.unlink(file_name) rescue nil

0 notes on commit d5025f1

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