From 909d638aecb3597536e912599f5ee355aac828c0 Mon Sep 17 00:00:00 2001 From: usa Date: Sun, 29 Aug 2010 00:50:58 +0000 Subject: * 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/pathname/test_pathname.rb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'test/pathname/test_pathname.rb') diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb index 8634c4893d..55ef46690d 100644 --- a/test/pathname/test_pathname.rb +++ b/test/pathname/test_pathname.rb @@ -944,11 +944,12 @@ class TestPathname < Test::Unit::TestCase 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 @@ class TestPathname < Test::Unit::TestCase 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 @@ class TestPathname < Test::Unit::TestCase 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 @@ class TestPathname < Test::Unit::TestCase 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 @@ class TestPathname < Test::Unit::TestCase 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") -- cgit v1.2.3