• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/ruby-106/ruby/test/uri/

Lines Matching refs:URI

4 class URI::TestGeneric < Test::Unit::TestCase
7 @base_url = URI.parse(@url)
19 assert_kind_of(URI::HTTP, @base_url)
23 nil, 'a', URI::HTTP.default_port,
32 url = URI.parse('ftp://ftp.is.co.za/rfc/rfc1808.txt')
33 assert_kind_of(URI::FTP, url)
37 nil, 'ftp.is.co.za', URI::FTP.default_port,
43 url = URI.parse('ftp://ftp.is.co.za/%2Frfc/rfc1808.txt')
44 assert_kind_of(URI::FTP, url)
48 nil, 'ftp.is.co.za', URI::FTP.default_port,
55 url = URI.parse('gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles')
56 assert_kind_of(URI::Generic, url)
69 url = URI.parse('http://www.math.uio.no/faq/compression-faq/part1.html')
70 assert_kind_of(URI::HTTP, url)
74 nil, 'www.math.uio.no', URI::HTTP.default_port,
83 url = URI.parse('mailto:mduerst@ifi.unizh.ch')
84 assert_kind_of(URI::Generic, url)
95 url = URI.parse('news:comp.infosystems.www.servers.unix')
96 assert_kind_of(URI::Generic, url)
109 url = URI.parse('telnet://melvyl.ucop.edu/')
110 assert_kind_of(URI::Generic, url)
124 assert_raise(URI::InvalidURIError) { URI.parse('http://a_b:80/') }
125 assert_raise(URI::InvalidURIError) { URI.parse('http://a_b/') }
129 uri = URI.parse('file:///foo/bar.txt')
130 assert_kind_of(URI::Generic, url)
131 uri = URI.parse('file:/foo/bar.txt')
132 assert_kind_of(URI::Generic, url)
135 url = URI.parse('ftp://:pass@localhost/')
139 url = URI.parse('ftp://user@localhost/')
143 url = URI.parse('ftp://localhost/')
150 u1 = URI.parse('http://foo')
151 u2 = URI.parse('http://foo/')
152 u3 = URI.parse('http://foo/bar')
153 u4 = URI.parse('http://foo/bar/')
155 assert_equal(URI.parse('http://foo/baz'), u1 + 'baz')
156 assert_equal(URI.parse('http://foo/baz'), u2 + 'baz')
157 assert_equal(URI.parse('http://foo/baz'), u3 + 'baz')
158 assert_equal(URI.parse('http://foo/bar/baz'), u4 + 'baz')
160 assert_equal(URI.parse('http://foo/baz'), u1 + '/baz')
161 assert_equal(URI.parse('http://foo/baz'), u2 + '/baz')
162 assert_equal(URI.parse('http://foo/baz'), u3 + '/baz')
163 assert_equal(URI.parse('http://foo/baz'), u4 + '/baz')
165 url = URI.parse('http://hoge/a.html') + 'b.html'
169 url = URI.parse('http://a/b') + 'http://x/y'
171 assert_equal(url, URI.parse('') + 'http://x/y')
172 assert_equal(url, URI.parse('').normalize + 'http://x/y')
173 assert_equal(url, URI.parse('http://a/b').normalize + 'http://x/y')
175 u = URI.parse('http://foo/bar/baz')
183 u0 = URI.parse('mailto:foo@example.com')
184 u1 = URI.parse('mailto:foo@example.com#bar')
187 u0 = URI.parse('http://www.example.com/')
188 u1 = URI.parse('http://www.example.com/foo/..') + './'
190 u0 = URI.parse('http://www.example.com/foo/')
191 u1 = URI.parse('http://www.example.com/foo/bar/..') + './'
193 u0 = URI.parse('http://www.example.com/foo/bar/')
194 u1 = URI.parse('http://www.example.com/foo/bar/baz/..') + './'
196 u0 = URI.parse('http://www.example.com/')
197 u1 = URI.parse('http://www.example.com/foo/bar/../..') + './'
199 u0 = URI.parse('http://www.example.com/foo/')
200 u1 = URI.parse('http://www.example.com/foo/bar/baz/../..') + './'
203 u = URI.parse('http://www.example.com/')
207 u = URI.parse('http://www.example.com/')
214 url = URI.parse('http://hoge/a.html').route_to('http://hoge/b.html')
217 url = URI.parse('http://hoge/a/').route_to('http://hoge/b/')
219 url = URI.parse('http://hoge/a/b').route_to('http://hoge/b/')
222 url = URI.parse('http://hoge/a/b/').route_to('http://hoge/b/')
225 url = URI.parse('http://hoge/a/b/').route_to('http://HOGE/b/')
228 url = URI.parse('http://hoge/a/b/').route_to('http://MOGE/b/')
231 url = URI.parse('http://hoge/b').route_to('http://hoge/b/')
233 url = URI.parse('http://hoge/b/a').route_to('http://hoge/b/')
235 url = URI.parse('http://hoge/b/').route_to('http://hoge/b')
237 url = URI.parse('http://hoge/b').route_to('http://hoge/b:c')
240 url = URI.parse('file:///a/b/').route_to('file:///a/b/')
242 url = URI.parse('file:///a/b/').route_to('file:///a/b')
245 url = URI.parse('mailto:foo@example.com').route_to('mailto:foo@example.com#bar')
248 url = URI.parse('mailto:foo@example.com#bar').route_to('mailto:foo@example.com')
251 url = URI.parse('mailto:foo@example.com').route_to('mailto:foo@example.com')
259 assert_kind_of(URI::Generic, url)
262 assert_kind_of(URI::Generic, url)
268 assert_kind_of(URI::HTTP, url)
271 assert_kind_of(URI::Generic, url)
277 assert_kind_of(URI::HTTP, url)
280 assert_kind_of(URI::Generic, url)
287 assert_kind_of(URI::HTTP, url)
290 assert_kind_of(URI::Generic, url)
296 assert_kind_of(URI::HTTP, url)
299 assert_kind_of(URI::Generic, url)
306 assert_kind_of(URI::HTTP, url)
309 assert_kind_of(URI::Generic, url)
315 assert_kind_of(URI::HTTP, url)
318 assert_kind_of(URI::Generic, url)
324 assert_kind_of(URI::HTTP, url)
327 assert_kind_of(URI::Generic, url)
333 assert_kind_of(URI::HTTP, url)
336 assert_kind_of(URI::Generic, url)
342 assert_kind_of(URI::HTTP, url)
345 assert_kind_of(URI::Generic, url)
351 assert_kind_of(URI::HTTP, url)
354 assert_kind_of(URI::Generic, url)
360 assert_kind_of(URI::HTTP, url)
363 assert_kind_of(URI::Generic, url)
369 assert_kind_of(URI::HTTP, url)
372 assert_kind_of(URI::Generic, url)
378 assert_kind_of(URI::HTTP, url)
381 assert_kind_of(URI::Generic, url)
387 assert_kind_of(URI::HTTP, url)
390 assert_kind_of(URI::Generic, url)
397 assert_kind_of(URI::HTTP, url)
400 assert_kind_of(URI::Generic, url)
406 assert_kind_of(URI::HTTP, url)
409 assert_kind_of(URI::Generic, url)
416 assert_kind_of(URI::HTTP, url)
419 assert_kind_of(URI::Generic, url)
425 assert_kind_of(URI::HTTP, url)
428 assert_kind_of(URI::Generic, url)
434 assert_kind_of(URI::HTTP, url)
437 assert_kind_of(URI::Generic, url)
444 assert_kind_of(URI::HTTP, url)
447 assert_kind_of(URI::Generic, url)
453 assert_kind_of(URI::HTTP, url)
456 assert_kind_of(URI::Generic, url)
462 assert_kind_of(URI::HTTP, url)
465 assert_kind_of(URI::Generic, url)
471 assert_kind_of(URI::HTTP, url)
474 # assert_kind_of(URI::Generic, url)
480 assert_kind_of(URI::HTTP, url)
483 # assert_kind_of(URI::Generic, url)
489 assert_kind_of(URI::HTTP, url)
492 assert_kind_of(URI::Generic, url)
498 assert_kind_of(URI::HTTP, url)
501 assert_kind_of(URI::Generic, url)
507 assert_kind_of(URI::HTTP, url)
510 assert_kind_of(URI::Generic, url)
516 assert_kind_of(URI::HTTP, url)
519 assert_kind_of(URI::Generic, url)
525 assert_kind_of(URI::HTTP, url)
528 assert_kind_of(URI::Generic, url)
535 assert_kind_of(URI::HTTP, url)
538 assert_kind_of(URI::Generic, url)
545 assert_kind_of(URI::HTTP, url)
548 assert_kind_of(URI::Generic, url)
555 assert_kind_of(URI::HTTP, url)
558 assert_kind_of(URI::Generic, url)
565 assert_kind_of(URI::HTTP, url)
568 assert_kind_of(URI::Generic, url)
575 assert_kind_of(URI::HTTP, url)
578 assert_kind_of(URI::Generic, url)
585 assert_kind_of(URI::HTTP, url)
588 assert_kind_of(URI::Generic, url)
595 assert_kind_of(URI::HTTP, url)
598 assert_kind_of(URI::Generic, url)
605 assert_kind_of(URI::HTTP, url)
608 assert_kind_of(URI::Generic, url)
614 assert_kind_of(URI::HTTP, url)
617 assert_kind_of(URI::Generic, url)
623 assert_kind_of(URI::HTTP, url)
626 assert_kind_of(URI::Generic, url)
632 assert_kind_of(URI::HTTP, url)
635 assert_kind_of(URI::Generic, url)
642 assert_kind_of(URI::HTTP, url)
645 assert_kind_of(URI::Generic, url)
650 assert_equal(URI.parse('http://foo/bar'), URI.join('http://foo/bar'))
651 assert_equal(URI.parse('http://foo/bar'), URI.join('http://foo', 'bar'))
652 assert_equal(URI.parse('http://foo/bar/'), URI.join('http://foo', 'bar/'))
654 assert_equal(URI.parse('http://foo/baz'), URI.join('http://foo', 'bar', 'baz'))
655 assert_equal(URI.parse('http://foo/baz'), URI.join('http://foo', 'bar', '/baz'))
656 assert_equal(URI.parse('http://foo/baz/'), URI.join('http://foo', 'bar', '/baz/'))
657 assert_equal(URI.parse('http://foo/bar/baz'), URI.join('http://foo', 'bar/', 'baz'))
658 assert_equal(URI.parse('http://foo/hoge'), URI.join('http://foo', 'bar', 'baz', 'hoge'))
660 assert_equal(URI.parse('http://foo/bar/baz'), URI.join('http://foo', 'bar/baz'))
661 assert_equal(URI.parse('http://foo/bar/hoge'), URI.join('http://foo', 'bar/baz', 'hoge'))
662 assert_equal(URI.parse('http://foo/bar/baz/hoge'), URI.join('http://foo', 'bar/baz/', 'hoge'))
663 assert_equal(URI.parse('http://foo/hoge'), URI.join('http://foo', 'bar/baz', '/hoge'))
664 assert_equal(URI.parse('http://foo/bar/hoge'), URI.join('http://foo', 'bar/baz', 'hoge'))
665 assert_equal(URI.parse('http://foo/bar/baz/hoge'), URI.join('http://foo', 'bar/baz/', 'hoge'))
666 assert_equal(URI.parse('http://foo/hoge'), URI.join('http://foo', 'bar/baz', '/hoge'))
671 uri = URI.parse('http://foo:bar@baz')
693 uri = URI.parse('http://example.com')
694 assert_raise(URI::InvalidURIError) { uri.password = 'bar' }
695 assert_raise(URI::InvalidComponentError) { uri.query = "foo\nbar" }
698 assert_raise(URI::InvalidURIError) { uri.registry = 'bar' }
699 assert_raise(URI::InvalidURIError) { uri.opaque = 'bar' }
701 uri = URI.parse('mailto:foo@example.com')
702 assert_raise(URI::InvalidURIError) { uri.user = 'bar' }
703 assert_raise(URI::InvalidURIError) { uri.password = 'bar' }
704 assert_raise(URI::InvalidURIError) { uri.userinfo = ['bar', 'baz'] }
705 assert_raise(URI::InvalidURIError) { uri.host = 'bar' }
706 assert_raise(URI::InvalidURIError) { uri.port = 'bar' }
707 assert_raise(URI::InvalidURIError) { uri.path = 'bar' }
708 assert_raise(URI::InvalidURIError) { uri.query = 'bar' }
712 uri = URI.parse 'HTTP://example'
718 assert_equal("[::1]", URI("http://[::1]/bar/baz").host)
719 assert_equal("::1", URI("http://[::1]/bar/baz").hostname)
721 u = URI("http://foo/bar")
728 URI::Generic.build(['http', nil, 'example.com', 80, nil, '/foo', nil, nil, nil])
732 URI::Generic.build2(path: "/foo bar/baz")
733 URI::Generic.build2(['http', nil, 'example.com', 80, nil, '/foo bar' , nil, nil, nil])
739 assert_raise(URI::BadURIError){ URI("foo").find_proxy }
741 assert_nil(URI("http://192.0.2.1/").find_proxy)
742 assert_nil(URI("ftp://192.0.2.1/").find_proxy)
745 assert_equal(URI('http://127.0.0.1:8080'), URI("http://192.0.2.1/").find_proxy)
746 assert_nil(URI("ftp://192.0.2.1/").find_proxy)
749 assert_nil(URI("http://192.0.2.1/").find_proxy)
750 assert_equal(URI('http://127.0.0.1:8080'), URI("ftp://192.0.2.1/").find_proxy)
753 assert_nil(URI("http://192.0.2.1/").find_proxy)
756 assert_equal(URI('http://127.0.0.1:8080'), URI("http://192.0.2.1/").find_proxy)
759 assert_equal(URI('http://127.0.0.1:8080'), URI("http://192.0.2.1/").find_proxy)
760 assert_nil(URI("http://192.0.2.2/").find_proxy)
763 assert_nil(URI("http://192.0.2.1/").find_proxy)
764 assert_nil(URI("ftp://192.0.2.1/").find_proxy)
767 assert_nil(URI("http://192.0.2.1/").find_proxy)
768 assert_nil(URI("ftp://192.0.2.1/").find_proxy)
774 assert_equal(URI('http://127.0.0.1:8080'), URI("http://192.0.2.1/").find_proxy)
777 assert_nil(nil, URI("http://192.0.2.1/").find_proxy)
780 assert_equal(URI('http://127.0.0.1:8080'), URI("http://192.0.2.1/").find_proxy)