diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-01 15:09:41 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-01 15:09:41 +0000 |
commit | ed48bfa5e8770a345424abd7f24f94ea9bbf5973 (patch) | |
tree | a0bd2fe2f6aa42658b94ad81876aa065fe0a7804 /test/uri/test_generic.rb | |
parent | 51716c331f4822546d76a4053bfc3610bbbfc0a2 (diff) | |
download | ruby-ed48bfa5e8770a345424abd7f24f94ea9bbf5973.tar.gz |
Append "//" if empty host for file or postgres URI
https://url.spec.whatwg.org/#url-serializing
> Otherwise, if url’s host is null and url’s scheme is "file", append "//" to output.
URL spec doesn't says anything about postgres, but assume the same thing.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/uri/test_generic.rb')
-rw-r--r-- | test/uri/test_generic.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb index aa782db27e..b77717f949 100644 --- a/test/uri/test_generic.rb +++ b/test/uri/test_generic.rb @@ -20,6 +20,10 @@ class URI::TestGeneric < Test::Unit::TestCase str = URI(exp).to_s assert_equal exp, str assert_not_predicate str, :frozen?, '[ruby-core:71785] [Bug #11759]' + + assert_equal "file:///foo", URI("file:///foo").to_s + assert_equal "postgres:///foo", URI("postgres:///foo").to_s + assert_equal "http:/foo", URI("http:///foo").to_s end def test_parse |