summaryrefslogtreecommitdiff
path: root/test/pathname/test_pathname.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-16 14:44:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-16 14:44:01 +0000
commit287533753347cb688d1d65bea6ef17724e237951 (patch)
treed45ac417c6a9b959f89e5b3ae8efce8cc773dd4d /test/pathname/test_pathname.rb
parent5a13c6bcd9c7c138fdbedb92a56efea6f9535416 (diff)
pathname.rb: UNC root pathname needs a separator
* ext/pathname/lib/pathname.rb (Pathname#plus): UNC root pathname needs a separator. File.basename returns "/" on UNC root, as well as sole drive letter, even if it does not end with a separator. [ruby-core:80900] [Bug #13515] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/pathname/test_pathname.rb')
-rw-r--r--test/pathname/test_pathname.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index 848d4e41904..1efd40121d6 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -14,8 +14,8 @@ class TestPathname < Test::Unit::TestCase
end
def self.get_linenum
- if /:(\d+):/ =~ caller[1]
- $1.to_i
+ if loc = caller_locations(2, 1)
+ loc[0].lineno
else
nil
end
@@ -221,6 +221,8 @@ class TestPathname < Test::Unit::TestCase
defassert(:plus, 'a//b/d//e', 'a//b/c', '../d//e')
+ defassert(:plus, '//foo/var/bar', '//foo/var', 'bar')
+
def test_slash
assert_kind_of(Pathname, Pathname("a") / Pathname("b"))
end