diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/pathname/test_pathname.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb index 848d4e4190..1efd40121d 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 |