diff options
author | S. Brent Faulkner <brentf@unwwwired.net> | 2008-08-13 19:19:00 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-08-13 19:19:00 -0500 |
commit | 3284fbb86629f398ba2634dd9369bc65beb7d6ae (patch) | |
tree | e0cb7129695ea3cf63b9a6bf9552688983c68c55 /activesupport | |
parent | 3b9324e62f770f1a0a457f7ad5fe6a3287ecae1f (diff) | |
download | rails-3284fbb86629f398ba2634dd9369bc65beb7d6ae.tar.gz rails-3284fbb86629f398ba2634dd9369bc65beb7d6ae.tar.bz2 rails-3284fbb86629f398ba2634dd9369bc65beb7d6ae.zip |
Use current umask when testing the expected file mode [#823 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/test/core_ext/file_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/test/core_ext/file_test.rb b/activesupport/test/core_ext/file_test.rb index 63b470684f..eedc6b592b 100644 --- a/activesupport/test/core_ext/file_test.rb +++ b/activesupport/test/core_ext/file_test.rb @@ -29,7 +29,7 @@ class AtomicWriteTest < Test::Unit::TestCase assert File.exist?(file_name) end assert File.exist?(file_name) - assert_equal "100755", file_mode + assert_equal 0100755, file_mode assert_equal contents, File.read(file_name) File.atomic_write(file_name, Dir.pwd) do |file| @@ -37,7 +37,7 @@ class AtomicWriteTest < Test::Unit::TestCase assert File.exist?(file_name) end assert File.exist?(file_name) - assert_equal "100755", file_mode + assert_equal 0100755, file_mode assert_equal contents, File.read(file_name) ensure File.unlink(file_name) rescue nil @@ -50,7 +50,7 @@ class AtomicWriteTest < Test::Unit::TestCase assert !File.exist?(file_name) end assert File.exist?(file_name) - assert_equal "100644", file_mode + assert_equal 0100666 ^ File.umask, file_mode assert_equal contents, File.read(file_name) ensure File.unlink(file_name) rescue nil @@ -62,6 +62,6 @@ class AtomicWriteTest < Test::Unit::TestCase end def file_mode - sprintf("%o", File.stat(file_name).mode) + File.stat(file_name).mode end end |