summaryrefslogtreecommitdiff
path: root/test/pathname
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-29 00:50:58 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-29 00:50:58 +0000
commit909d638aecb3597536e912599f5ee355aac828c0 (patch)
tree2209c095651d0a43db6c8c30fb3392a9b47b1d3c /test/pathname
parent000f1c5b759ba08b8ca29456376202e4d5536812 (diff)
downloadruby-909d638aecb3597536e912599f5ee355aac828c0.tar.gz
* 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
Diffstat (limited to 'test/pathname')
-rw-r--r--test/pathname/test_pathname.rb15
1 files changed, 10 insertions, 5 deletions
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")