aboutsummaryrefslogtreecommitdiffstats
path: root/test/uri
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-04-15 06:21:56 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-04-15 06:21:56 +0000
commit733d4294fc6843ce49a8a8b41ba464b40a7718e7 (patch)
treeac2158401d7092058a24c54067ac8f9605a399ca /test/uri
parent835693dac5bd2d38cac972adbfd7980c305435a4 (diff)
downloadruby-733d4294fc6843ce49a8a8b41ba464b40a7718e7.tar.gz
Add some more tests for the previous fix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/uri')
-rw-r--r--test/uri/test_generic.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb
index 1866b37f54..cfd92e7b26 100644
--- a/test/uri/test_generic.rb
+++ b/test/uri/test_generic.rb
@@ -222,15 +222,21 @@ class URI::TestGeneric < Test::Unit::TestCase
url = URI.parse('http://hoge/a/b/').route_to('http://hoge/b/')
assert_equal('../../b/', url.to_s)
- url = URI.parse('http://hoge/a/b/').route_to('http://hoge/a/b')
- assert_equal('../b', url.to_s)
-
url = URI.parse('http://hoge/a/b/').route_to('http://HOGE/b/')
assert_equal('../../b/', url.to_s)
url = URI.parse('http://hoge/a/b/').route_to('http://MOGE/b/')
assert_equal('//MOGE/b/', url.to_s)
+ url = URI.parse('http://hoge/b').route_to('http://hoge/b/')
+ assert_equal('b/', url.to_s)
+ url = URI.parse('http://hoge/b/a').route_to('http://hoge/b/')
+ assert_equal('./', url.to_s)
+ url = URI.parse('http://hoge/b/').route_to('http://hoge/b')
+ assert_equal('../b', url.to_s)
+ url = URI.parse('http://hoge/b').route_to('http://hoge/b:c')
+ assert_equal('./b:c', url.to_s)
+
url = URI.parse('file:///a/b/').route_to('file:///a/b/')
assert_equal('', url.to_s)
url = URI.parse('file:///a/b/').route_to('file:///a/b')