diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-20 01:40:51 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-20 01:40:51 +0000 |
commit | 19fb560d219f583066241293f2e0f92cd898595e (patch) | |
tree | 63c015fc3945906077e2489c587fa800b9c2160a /test | |
parent | 1fa5a50cd05de69d94815757da628eab29471a1f (diff) | |
download | ruby-19fb560d219f583066241293f2e0f92cd898595e.tar.gz |
* 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')
-rw-r--r-- | test/pathname/test_pathname.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb index 125eb39509..9adecb5b05 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 |