summaryrefslogtreecommitdiff
path: root/test/pathname/test_pathname.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/pathname/test_pathname.rb')
-rw-r--r--test/pathname/test_pathname.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index eaecc52475..af523f9f98 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -471,6 +471,12 @@ class TestPathname < Test::Unit::TestCase
assert_raise(ArgumentError) { Pathname.new("a\0") }
end
+ def test_global_constructor
+ p = Pathname.new('a')
+ assert_equal(p, Pathname('a'))
+ assert_same(p, Pathname(p))
+ end
+
class AnotherStringLike # :nodoc:
def initialize(s) @s = s end
def to_str() @s end