ruby-changes:17132
From: usa <ko1@a...>
Date: Sun, 29 Aug 2010 09:57:04 +0900 (JST)
Subject: [ruby-changes:17132] Ruby:r29132 (trunk): * test/pathname/test_pathname.rb (test_expand_path): should treat drive letter.
usa 2010-08-29 09:50:58 +0900 (Sun, 29 Aug 2010) New Revision: 29132 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29132 Log: * test/pathname/test_pathname.rb (test_expand_path): should treat drive letter. * test/pathname/test_pathnamr.rb (test_grpowned?): group onwer is not suppoted on DOSISH platforms. * test/pathname/test_pathnamr.rb (test_world_readable?, test_sticky?, test_world_writable?): skip some tests on the assumptions for Unix on DOSISH. Modified files: trunk/test/pathname/test_pathname.rb Index: test/pathname/test_pathname.rb =================================================================== --- test/pathname/test_pathname.rb (revision 29131) +++ test/pathname/test_pathname.rb (revision 29132) @@ -944,11 +944,12 @@ end def test_expand_path - assert_equal(Pathname("/a"), Pathname("/a").expand_path) - assert_equal(Pathname("/a"), Pathname("a").expand_path("/")) - assert_equal(Pathname("/a"), Pathname("a").expand_path(Pathname("/"))) - assert_equal(Pathname("/b"), Pathname("/b").expand_path(Pathname("/a"))) - assert_equal(Pathname("/a/b"), Pathname("b").expand_path(Pathname("/a"))) + drv = DOSISH_DRIVE_LETTER ? Dir.pwd.sub(%r(/.*), '') : "" + assert_equal(Pathname(drv + "/a"), Pathname("/a").expand_path) + assert_equal(Pathname(drv + "/a"), Pathname("a").expand_path("/")) + assert_equal(Pathname(drv + "/a"), Pathname("a").expand_path(Pathname("/"))) + assert_equal(Pathname(drv + "/b"), Pathname("/b").expand_path(Pathname("/a"))) + assert_equal(Pathname(drv + "/a/b"), Pathname("b").expand_path(Pathname("/a"))) end def test_split @@ -991,6 +992,7 @@ end def test_grpowned? + skip "Unix file owner test" if DOSISH with_tmpchdir('rubytest-pathname') {|dir| open("f", "w") {|f| f.write "abc" } assert_equal(true, Pathname("f").grpowned?) @@ -1044,6 +1046,7 @@ end def test_world_readable? + skip "Unix file mode bit test" if DOSISH with_tmpchdir('rubytest-pathname') {|dir| open("f", "w") {|f| f.write "abc" } File.chmod(0400, "f") @@ -1095,6 +1098,7 @@ end def test_sticky? + skip "Unix file mode bit test" if DOSISH with_tmpchdir('rubytest-pathname') {|dir| open("f", "w") {|f| f.write "abc" } assert_equal(false, Pathname("f").sticky?) @@ -1116,6 +1120,7 @@ end def test_world_writable? + skip "Unix file mode bit test" if DOSISH with_tmpchdir('rubytest-pathname') {|dir| open("f", "w") {|f| f.write "abc" } File.chmod(0600, "f") -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/