summaryrefslogtreecommitdiff
path: root/test/pathname
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-25 14:42:36 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-25 14:42:36 +0000
commit6df5f314ac7809e2aedc22a961cf31c4e3f21d42 (patch)
treeb77d23e464ab684fbc4576b4f6cf8bcae4825927 /test/pathname
parent602a9c1416e0519f95c502ff13110e5dd08d199d (diff)
remove unnecessary unshift
* ext/pathname/lib/pathname.rb (Pathname#join): remove unnecessary unshift. * test/pathname/test_pathname.rb (TestPathname#test_join): add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45407 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 ed79b5b..94bd8d8 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -234,6 +234,14 @@ class TestPathname < Test::Unit::TestCase
def test_join
r = Pathname("a").join(Pathname("b"), Pathname("c"))
assert_equal(Pathname("a/b/c"), r)
+ r = Pathname("/a").join(Pathname("b"), Pathname("c"))
+ assert_equal(Pathname("/a/b/c"), r)
+ r = Pathname("/a").join(Pathname("/b"), Pathname("c"))
+ assert_equal(Pathname("/b/c"), r)
+ r = Pathname("/a").join(Pathname("/b"), Pathname("/c"))
+ assert_equal(Pathname("/c"), r)
+ r = Pathname("/a").join("/b", "/c")
+ assert_equal(Pathname("/c"), r)
end
def test_absolute