Bug #3985
closedtest_pathname fail on OSX via cron
Description
=begin
Shota Fukumori (sora_h)です
pathnameのtest_grpowned?がcron上でfailします。
- Failure:
test_grpowned?(TestPathname) [/Users/sorah/git/ruby/ruby/test/pathname/test_pathname.rb:998]:
expected but was
.
原因はOSXの/tmp以下のdirectoryがwheelになるからで、File.chownすることで解消しました。
(なぜかコマンドラインからの実行だとfailしないけども)
パッチは以下です (git diff --no-prefixで生成):
diff --git test/pathname/test_pathname.rb test/pathname/test_pathname.rb
index 235d0fb..86b85b8 100644
--- test/pathname/test_pathname.rb
+++ test/pathname/test_pathname.rb
@@ -995,6 +995,7 @@ class TestPathname < Test::Unit::TestCase
skip "Unix file owner test" if DOSISH
with_tmpchdir('rubytest-pathname') {|dir|
open("f", "w") {|f| f.write "abc" }
-
}File.chown(-1, Process.gid, "f") assert_equal(true, Pathname("f").grpowned?)
end
=end
Updated by usa (Usaku NAKAMURA) about 14 years ago
- Status changed from Open to Assigned
- Assignee set to akr (Akira Tanaka)
=begin
=end
Updated by sorah (Sorah Fukumori) about 14 years ago
=begin
sora_hです。
以下パッチのほうが効果的かもしれません。
diff --git test/pathname/test_pathname.rb test/pathname/test_pathname.rb
index 235d0fb..ea709c3 100644
--- test/pathname/test_pathname.rb
+++ test/pathname/test_pathname.rb
@@ -309,6 +309,7 @@ class TestPathname < Test::Unit::TestCase
def with_tmpchdir(base=nil)
Dir.mktmpdir(base) {|d|
d = Pathname.new(d).realpath.to_s
-
File.chown(-1, Process.gid, d) Dir.chdir(d) { yield d }
=end
Updated by akr (Akira Tanaka) about 14 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r29632.
Shota, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end