summaryrefslogtreecommitdiff
path: root/test/uri/test_generic.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/uri/test_generic.rb')
-rw-r--r--test/uri/test_generic.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb
index 3897c3d6ee..8209363b82 100644
--- a/test/uri/test_generic.rb
+++ b/test/uri/test_generic.rb
@@ -26,6 +26,17 @@ class URI::TestGeneric < Test::Unit::TestCase
assert_equal "postgres:///foo", URI("postgres:///foo").to_s
assert_equal "http:///foo", URI("http:///foo").to_s
assert_equal "http:/foo", URI("http:/foo").to_s
+
+ uri = URI('rel_path')
+ assert_equal "rel_path", uri.to_s
+ uri.scheme = 'http'
+ assert_equal "http:rel_path", uri.to_s
+ uri.host = 'h'
+ assert_equal "http://h/rel_path", uri.to_s
+ uri.port = 8080
+ assert_equal "http://h:8080/rel_path", uri.to_s
+ uri.host = nil
+ assert_equal "http::8080/rel_path", uri.to_s
end
def test_parse
@@ -977,6 +988,10 @@ class URI::TestGeneric < Test::Unit::TestCase
end
end
+ def test_split
+ assert_equal [nil, nil, nil, nil, nil, "", nil, nil, nil], URI.split("//")
+ end
+
class CaseInsensitiveEnv
def initialize(h={})
@h = {}