ruby-changes:59321
From: Nobuyoshi <ko1@a...>
Date: Wed, 18 Dec 2019 13:38:10 +0900 (JST)
Subject: [ruby-changes:59321] fcd8bafd08 (master): Use a temporary file for chown test
https://git.ruby-lang.org/ruby.git/commit/?id=fcd8bafd08 From fcd8bafd086a7105b535ec1691f960e37d5c911b Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Wed, 18 Dec 2019 13:35:58 +0900 Subject: Use a temporary file for chown test Errno::EROFS may occur when the source tree is placed in a read-only filesystem. diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb index 96e2ca2..d570b6f 100644 --- a/test/ruby/test_file.rb +++ b/test/ruby/test_file.rb @@ -233,11 +233,9 @@ class TestFile < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_file.rb#L233 end def test_chown - assert_nothing_raised { - File.open(__FILE__) {|f| f.chown(-1, -1) } - } - assert_nothing_raised("[ruby-dev:27140]") { - File.open(__FILE__) {|f| f.chown nil, nil } + Tempfile.create("test-chown") {|f| + assert_nothing_raised {f.chown(-1, -1)} + assert_nothing_raised("[ruby-dev:27140]") {f.chown(nil, nil)} } end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/