summaryrefslogtreecommitdiff
path: root/test/pathname
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-20 01:40:51 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-20 01:40:51 +0000
commit19fb560d219f583066241293f2e0f92cd898595e (patch)
tree63c015fc3945906077e2489c587fa800b9c2160a /test/pathname
parent1fa5a50cd05de69d94815757da628eab29471a1f (diff)
* ext/pathname/pathname.c (path_expand_path): Pathname#expand_path
translated from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/pathname')
-rw-r--r--test/pathname/test_pathname.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index 125eb39..9adecb5 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -926,6 +926,14 @@ class TestPathname < Test::Unit::TestCase
assert_equal(".ext", Pathname("basename.ext").extname)
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")))
+ end
+
def test_split
assert_equal([Pathname("dirname"), Pathname("basename")], Pathname("dirname/basename").split)
end