mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
000f1c5b75
commit
909d638aec
1 changed files with 10 additions and 5 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Reference in a new issue