1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Use a temporary file for chown test

Errno::EROFS may occur when the source tree is placed in a
read-only filesystem.
This commit is contained in:
Nobuyoshi Nakada 2019-12-18 13:35:58 +09:00
parent c147eeff7c
commit fcd8bafd08
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -233,11 +233,9 @@ class TestFile < Test::Unit::TestCase
end end
def test_chown def test_chown
assert_nothing_raised { Tempfile.create("test-chown") {|f|
File.open(__FILE__) {|f| f.chown(-1, -1) } assert_nothing_raised {f.chown(-1, -1)}
} assert_nothing_raised("[ruby-dev:27140]") {f.chown(nil, nil)}
assert_nothing_raised("[ruby-dev:27140]") {
File.open(__FILE__) {|f| f.chown nil, nil }
} }
end end