Project

General

Profile

Actions

Bug #3985

closed

test_pathname fail on OSX via cron

Added by sorah (Sorah Fukumori) about 14 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.3dev (2010-10-26 trunk 29598) [x86_64-darwin10.4.0]
Backport:
[ruby-dev:42458]

Description

=begin
Shota Fukumori (sora_h)です

pathnameのtest_grpowned?がcron上でfailします。

  1. 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

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #344: File.grpowned?のテストClosedznz (Kazuhiro NISHIYAMA)Actions
Actions #1

Updated by usa (Usaku NAKAMURA) about 14 years ago

  • Status changed from Open to Assigned
  • Assignee set to akr (Akira Tanaka)

=begin

=end

Actions #2

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

Actions #3

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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0