mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/uri/test_generic.rb (URI#test_merge): Test uri + URI(path)
in addition to uri + path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f0dfcefa48
commit
d3edb4a85e
2 changed files with 30 additions and 9 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Nov 21 16:25:08 2013 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
|
* test/uri/test_generic.rb (URI#test_merge): Test uri + URI(path)
|
||||||
|
in addition to uri + path.
|
||||||
|
|
||||||
Thu Nov 21 15:36:08 2013 Zachary Scott <e@zzak.io>
|
Thu Nov 21 15:36:08 2013 Zachary Scott <e@zzak.io>
|
||||||
|
|
||||||
* ext/openssl/lib/openssl/buffering.rb: [DOC] Fix HEREDOC comment for
|
* ext/openssl/lib/openssl/buffering.rb: [DOC] Fix HEREDOC comment for
|
||||||
|
|
|
@ -152,15 +152,31 @@ class URI::TestGeneric < Test::Unit::TestCase
|
||||||
u3 = URI.parse('http://foo/bar')
|
u3 = URI.parse('http://foo/bar')
|
||||||
u4 = URI.parse('http://foo/bar/')
|
u4 = URI.parse('http://foo/bar/')
|
||||||
|
|
||||||
assert_equal(URI.parse('http://foo/baz'), u1 + 'baz')
|
{
|
||||||
assert_equal(URI.parse('http://foo/baz'), u2 + 'baz')
|
u1 => {
|
||||||
assert_equal(URI.parse('http://foo/baz'), u3 + 'baz')
|
'baz' => 'http://foo/baz',
|
||||||
assert_equal(URI.parse('http://foo/bar/baz'), u4 + 'baz')
|
'/baz' => 'http://foo/baz',
|
||||||
|
},
|
||||||
assert_equal(URI.parse('http://foo/baz'), u1 + '/baz')
|
u2 => {
|
||||||
assert_equal(URI.parse('http://foo/baz'), u2 + '/baz')
|
'baz' => 'http://foo/baz',
|
||||||
assert_equal(URI.parse('http://foo/baz'), u3 + '/baz')
|
'/baz' => 'http://foo/baz',
|
||||||
assert_equal(URI.parse('http://foo/baz'), u4 + '/baz')
|
},
|
||||||
|
u3 => {
|
||||||
|
'baz' => 'http://foo/baz',
|
||||||
|
'/baz' => 'http://foo/baz',
|
||||||
|
},
|
||||||
|
u4 => {
|
||||||
|
'baz' => 'http://foo/bar/baz',
|
||||||
|
'/baz' => 'http://foo/baz',
|
||||||
|
},
|
||||||
|
}.each { |base, map|
|
||||||
|
map.each { |url, result|
|
||||||
|
expected = URI.parse(result)
|
||||||
|
uri = URI.parse(url)
|
||||||
|
assert_equal expected, base + url, "<#{base}> + #{url.inspect} to become <#{expected}>"
|
||||||
|
assert_equal expected, base + uri, "<#{base}> + <#{uri}> to become <#{expected}>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
url = URI.parse('http://hoge/a.html') + 'b.html'
|
url = URI.parse('http://hoge/a.html') + 'b.html'
|
||||||
assert_equal('http://hoge/b.html', url.to_s, "[ruby-dev:11508]")
|
assert_equal('http://hoge/b.html', url.to_s, "[ruby-dev:11508]")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue