• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/ruby-104/ruby/test/uri/

Lines Matching refs:url

6     @url = 'http://a/b/c/d;p?q'
7 @base_url = URI.parse(@url)
32 url = URI.parse('ftp://ftp.is.co.za/rfc/rfc1808.txt')
33 assert_kind_of(URI::FTP, url)
40 ary = uri_to_ary(url)
43 url = URI.parse('ftp://ftp.is.co.za/%2Frfc/rfc1808.txt')
44 assert_kind_of(URI::FTP, url)
51 ary = uri_to_ary(url)
55 url = URI.parse('gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles')
56 assert_kind_of(URI::Generic, url)
65 ary = uri_to_ary(url)
69 url = URI.parse('http://www.math.uio.no/faq/compression-faq/part1.html')
70 assert_kind_of(URI::HTTP, url)
79 ary = uri_to_ary(url)
83 url = URI.parse('mailto:mduerst@ifi.unizh.ch')
84 assert_kind_of(URI::Generic, url)
91 ary = uri_to_ary(url)
95 url = URI.parse('news:comp.infosystems.www.servers.unix')
96 assert_kind_of(URI::Generic, url)
105 ary = uri_to_ary(url)
109 url = URI.parse('telnet://melvyl.ucop.edu/')
110 assert_kind_of(URI::Generic, url)
119 ary = uri_to_ary(url)
130 assert_kind_of(URI::Generic, url)
132 assert_kind_of(URI::Generic, url)
135 url = URI.parse('ftp://:pass@localhost/')
136 assert_equal('', url.user, "[ruby-dev:25667]")
137 assert_equal('pass', url.password)
138 assert_equal(':pass', url.userinfo, "[ruby-dev:25667]")
139 url = URI.parse('ftp://user@localhost/')
140 assert_equal('user', url.user)
141 assert_equal(nil, url.password)
142 assert_equal('user', url.userinfo)
143 url = URI.parse('ftp://localhost/')
144 assert_equal(nil, url.user)
145 assert_equal(nil, url.password)
146 assert_equal(nil, url.userinfo)
165 url = URI.parse('http://hoge/a.html') + 'b.html'
166 assert_equal('http://hoge/b.html', url.to_s, "[ruby-dev:11508]")
169 url = URI.parse('http://a/b') + 'http://x/y'
170 assert_equal('http://x/y', url.to_s)
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')
214 url = URI.parse('http://hoge/a.html').route_to('http://hoge/b.html')
215 assert_equal('b.html', url.to_s)
217 url = URI.parse('http://hoge/a/').route_to('http://hoge/b/')
218 assert_equal('../b/', url.to_s)
219 url = URI.parse('http://hoge/a/b').route_to('http://hoge/b/')
220 assert_equal('../b/', url.to_s)
222 url = URI.parse('http://hoge/a/b/').route_to('http://hoge/b/')
223 assert_equal('../../b/', url.to_s)
225 url = URI.parse('http://hoge/a/b/').route_to('http://HOGE/b/')
226 assert_equal('../../b/', url.to_s)
228 url = URI.parse('http://hoge/a/b/').route_to('http://MOGE/b/')
229 assert_equal('//MOGE/b/', url.to_s)
231 url = URI.parse('http://hoge/b').route_to('http://hoge/b/')
232 assert_equal('b/', url.to_s)
233 url = URI.parse('http://hoge/b/a').route_to('http://hoge/b/')
234 assert_equal('./', url.to_s)
235 url = URI.parse('http://hoge/b/').route_to('http://hoge/b')
236 assert_equal('../b', url.to_s)
237 url = URI.parse('http://hoge/b').route_to('http://hoge/b:c')
238 assert_equal('./b:c', url.to_s)
240 url = URI.parse('file:///a/b/').route_to('file:///a/b/')
241 assert_equal('', url.to_s)
242 url = URI.parse('file:///a/b/').route_to('file:///a/b')
243 assert_equal('../b', url.to_s)
245 url = URI.parse('mailto:foo@example.com').route_to('mailto:foo@example.com#bar')
246 assert_equal('#bar', url.to_s)
248 url = URI.parse('mailto:foo@example.com#bar').route_to('mailto:foo@example.com')
249 assert_equal('', url.to_s)
251 url = URI.parse('mailto:foo@example.com').route_to('mailto:foo@example.com')
252 assert_equal('', url.to_s)
258 url = @base_url.merge('g:h')
259 assert_kind_of(URI::Generic, url)
260 assert_equal('g:h', url.to_s)
261 url = @base_url.route_to('g:h')
262 assert_kind_of(URI::Generic, url)
263 assert_equal('g:h', url.to_s)
267 url = @base_url.merge('g')
268 assert_kind_of(URI::HTTP, url)
269 assert_equal('http://a/b/c/g', url.to_s)
270 url = @base_url.route_to('http://a/b/c/g')
271 assert_kind_of(URI::Generic, url)
272 assert_equal('g', url.to_s)
276 url = @base_url.merge('./g')
277 assert_kind_of(URI::HTTP, url)
278 assert_equal('http://a/b/c/g', url.to_s)
279 url = @base_url.route_to('http://a/b/c/g')
280 assert_kind_of(URI::Generic, url)
281 assert('./g' != url.to_s) # ok
282 assert_equal('g', url.to_s)
286 url = @base_url.merge('g/')
287 assert_kind_of(URI::HTTP, url)
288 assert_equal('http://a/b/c/g/', url.to_s)
289 url = @base_url.route_to('http://a/b/c/g/')
290 assert_kind_of(URI::Generic, url)
291 assert_equal('g/', url.to_s)
295 url = @base_url.merge('/g')
296 assert_kind_of(URI::HTTP, url)
297 assert_equal('http://a/g', url.to_s)
298 url = @base_url.route_to('http://a/g')
299 assert_kind_of(URI::Generic, url)
300 assert('/g' != url.to_s) # ok
301 assert_equal('../../g', url.to_s)
305 url = @base_url.merge('//g')
306 assert_kind_of(URI::HTTP, url)
307 assert_equal('http://g', url.to_s)
308 url = @base_url.route_to('http://g')
309 assert_kind_of(URI::Generic, url)
310 assert_equal('//g', url.to_s)
314 url = @base_url.merge('?y')
315 assert_kind_of(URI::HTTP, url)
316 assert_equal('http://a/b/c/d;p?y', url.to_s)
317 url = @base_url.route_to('http://a/b/c/d;p?y')
318 assert_kind_of(URI::Generic, url)
319 assert_equal('?y', url.to_s)
323 url = @base_url.merge('g?y')
324 assert_kind_of(URI::HTTP, url)
325 assert_equal('http://a/b/c/g?y', url.to_s)
326 url = @base_url.route_to('http://a/b/c/g?y')
327 assert_kind_of(URI::Generic, url)
328 assert_equal('g?y', url.to_s)
332 url = @base_url.merge('#s')
333 assert_kind_of(URI::HTTP, url)
334 assert_equal('http://a/b/c/d;p?q#s', url.to_s)
335 url = @base_url.route_to('http://a/b/c/d;p?q#s')
336 assert_kind_of(URI::Generic, url)
337 assert_equal('#s', url.to_s)
341 url = @base_url.merge('g#s')
342 assert_kind_of(URI::HTTP, url)
343 assert_equal('http://a/b/c/g#s', url.to_s)
344 url = @base_url.route_to('http://a/b/c/g#s')
345 assert_kind_of(URI::Generic, url)
346 assert_equal('g#s', url.to_s)
350 url = @base_url.merge('g?y#s')
351 assert_kind_of(URI::HTTP, url)
352 assert_equal('http://a/b/c/g?y#s', url.to_s)
353 url = @base_url.route_to('http://a/b/c/g?y#s')
354 assert_kind_of(URI::Generic, url)
355 assert_equal('g?y#s', url.to_s)
359 url = @base_url.merge(';x')
360 assert_kind_of(URI::HTTP, url)
361 assert_equal('http://a/b/c/;x', url.to_s)
362 url = @base_url.route_to('http://a/b/c/;x')
363 assert_kind_of(URI::Generic, url)
364 assert_equal(';x', url.to_s)
368 url = @base_url.merge('g;x')
369 assert_kind_of(URI::HTTP, url)
370 assert_equal('http://a/b/c/g;x', url.to_s)
371 url = @base_url.route_to('http://a/b/c/g;x')
372 assert_kind_of(URI::Generic, url)
373 assert_equal('g;x', url.to_s)
377 url = @base_url.merge('g;x?y#s')
378 assert_kind_of(URI::HTTP, url)
379 assert_equal('http://a/b/c/g;x?y#s', url.to_s)
380 url = @base_url.route_to('http://a/b/c/g;x?y#s')
381 assert_kind_of(URI::Generic, url)
382 assert_equal('g;x?y#s', url.to_s)
386 url = @base_url.merge('.')
387 assert_kind_of(URI::HTTP, url)
388 assert_equal('http://a/b/c/', url.to_s)
389 url = @base_url.route_to('http://a/b/c/')
390 assert_kind_of(URI::Generic, url)
391 assert('.' != url.to_s) # ok
392 assert_equal('./', url.to_s)
396 url = @base_url.merge('./')
397 assert_kind_of(URI::HTTP, url)
398 assert_equal('http://a/b/c/', url.to_s)
399 url = @base_url.route_to('http://a/b/c/')
400 assert_kind_of(URI::Generic, url)
401 assert_equal('./', url.to_s)
405 url = @base_url.merge('..')
406 assert_kind_of(URI::HTTP, url)
407 assert_equal('http://a/b/', url.to_s)
408 url = @base_url.route_to('http://a/b/')
409 assert_kind_of(URI::Generic, url)
410 assert('..' != url.to_s) # ok
411 assert_equal('../', url.to_s)
415 url = @base_url.merge('../')
416 assert_kind_of(URI::HTTP, url)
417 assert_equal('http://a/b/', url.to_s)
418 url = @base_url.route_to('http://a/b/')
419 assert_kind_of(URI::Generic, url)
420 assert_equal('../', url.to_s)
424 url = @base_url.merge('../g')
425 assert_kind_of(URI::HTTP, url)
426 assert_equal('http://a/b/g', url.to_s)
427 url = @base_url.route_to('http://a/b/g')
428 assert_kind_of(URI::Generic, url)
429 assert_equal('../g', url.to_s)
433 url = @base_url.merge('../..')
434 assert_kind_of(URI::HTTP, url)
435 assert_equal('http://a/', url.to_s)
436 url = @base_url.route_to('http://a/')
437 assert_kind_of(URI::Generic, url)
438 assert('../..' != url.to_s) # ok
439 assert_equal('../../', url.to_s)
443 url = @base_url.merge('../../')
444 assert_kind_of(URI::HTTP, url)
445 assert_equal('http://a/', url.to_s)
446 url = @base_url.route_to('http://a/')
447 assert_kind_of(URI::Generic, url)
448 assert_equal('../../', url.to_s)
452 url = @base_url.merge('../../g')
453 assert_kind_of(URI::HTTP, url)
454 assert_equal('http://a/g', url.to_s)
455 url = @base_url.route_to('http://a/g')
456 assert_kind_of(URI::Generic, url)
457 assert_equal('../../g', url.to_s)
461 url = @base_url.merge('')
462 assert_kind_of(URI::HTTP, url)
463 assert_equal('http://a/b/c/d;p?q', url.to_s)
464 url = @base_url.route_to('http://a/b/c/d;p?q')
465 assert_kind_of(URI::Generic, url)
466 assert_equal('', url.to_s)
470 url = @base_url.merge('/./g')
471 assert_kind_of(URI::HTTP, url)
472 assert_equal('http://a/g', url.to_s)
473 # url = @base_url.route_to('http://a/./g')
474 # assert_kind_of(URI::Generic, url)
475 # assert_equal('/./g', url.to_s)
479 url = @base_url.merge('/../g')
480 assert_kind_of(URI::HTTP, url)
481 assert_equal('http://a/g', url.to_s)
482 # url = @base_url.route_to('http://a/../g')
483 # assert_kind_of(URI::Generic, url)
484 # assert_equal('/../g', url.to_s)
488 url = @base_url.merge('g.')
489 assert_kind_of(URI::HTTP, url)
490 assert_equal('http://a/b/c/g.', url.to_s)
491 url = @base_url.route_to('http://a/b/c/g.')
492 assert_kind_of(URI::Generic, url)
493 assert_equal('g.', url.to_s)
497 url = @base_url.merge('.g')
498 assert_kind_of(URI::HTTP, url)
499 assert_equal('http://a/b/c/.g', url.to_s)
500 url = @base_url.route_to('http://a/b/c/.g')
501 assert_kind_of(URI::Generic, url)
502 assert_equal('.g', url.to_s)
506 url = @base_url.merge('g..')
507 assert_kind_of(URI::HTTP, url)
508 assert_equal('http://a/b/c/g..', url.to_s)
509 url = @base_url.route_to('http://a/b/c/g..')
510 assert_kind_of(URI::Generic, url)
511 assert_equal('g..', url.to_s)
515 url = @base_url.merge('..g')
516 assert_kind_of(URI::HTTP, url)
517 assert_equal('http://a/b/c/..g', url.to_s)
518 url = @base_url.route_to('http://a/b/c/..g')
519 assert_kind_of(URI::Generic, url)
520 assert_equal('..g', url.to_s)
524 url = @base_url.merge('../../../g')
525 assert_kind_of(URI::HTTP, url)
526 assert_equal('http://a/g', url.to_s)
527 url = @base_url.route_to('http://a/g')
528 assert_kind_of(URI::Generic, url)
529 assert('../../../g' != url.to_s) # ok? yes, it confuses you
530 assert_equal('../../g', url.to_s) # and it is clearly
534 url = @base_url.merge('../../../../g')
535 assert_kind_of(URI::HTTP, url)
536 assert_equal('http://a/g', url.to_s)
537 url = @base_url.route_to('http://a/g')
538 assert_kind_of(URI::Generic, url)
539 assert('../../../../g' != url.to_s) # ok? yes, it confuses you
540 assert_equal('../../g', url.to_s) # and it is clearly
544 url = @base_url.merge('./../g')
545 assert_kind_of(URI::HTTP, url)
546 assert_equal('http://a/b/g', url.to_s)
547 url = @base_url.route_to('http://a/b/g')
548 assert_kind_of(URI::Generic, url)
549 assert('./../g' != url.to_s) # ok
550 assert_equal('../g', url.to_s)
554 url = @base_url.merge('./g/.')
555 assert_kind_of(URI::HTTP, url)
556 assert_equal('http://a/b/c/g/', url.to_s)
557 url = @base_url.route_to('http://a/b/c/g/')
558 assert_kind_of(URI::Generic, url)
559 assert('./g/.' != url.to_s) # ok
560 assert_equal('g/', url.to_s)
564 url = @base_url.merge('g/./h')
565 assert_kind_of(URI::HTTP, url)
566 assert_equal('http://a/b/c/g/h', url.to_s)
567 url = @base_url.route_to('http://a/b/c/g/h')
568 assert_kind_of(URI::Generic, url)
569 assert('g/./h' != url.to_s) # ok
570 assert_equal('g/h', url.to_s)
574 url = @base_url.merge('g/../h')
575 assert_kind_of(URI::HTTP, url)
576 assert_equal('http://a/b/c/h', url.to_s)
577 url = @base_url.route_to('http://a/b/c/h')
578 assert_kind_of(URI::Generic, url)
579 assert('g/../h' != url.to_s) # ok
580 assert_equal('h', url.to_s)
584 url = @base_url.merge('g;x=1/./y')
585 assert_kind_of(URI::HTTP, url)
586 assert_equal('http://a/b/c/g;x=1/y', url.to_s)
587 url = @base_url.route_to('http://a/b/c/g;x=1/y')
588 assert_kind_of(URI::Generic, url)
589 assert('g;x=1/./y' != url.to_s) # ok
590 assert_equal('g;x=1/y', url.to_s)
594 url = @base_url.merge('g;x=1/../y')
595 assert_kind_of(URI::HTTP, url)
596 assert_equal('http://a/b/c/y', url.to_s)
597 url = @base_url.route_to('http://a/b/c/y')
598 assert_kind_of(URI::Generic, url)
599 assert('g;x=1/../y' != url.to_s) # ok
600 assert_equal('y', url.to_s)
604 url = @base_url.merge('g?y/./x')
605 assert_kind_of(URI::HTTP, url)
606 assert_equal('http://a/b/c/g?y/./x', url.to_s)
607 url = @base_url.route_to('http://a/b/c/g?y/./x')
608 assert_kind_of(URI::Generic, url)
609 assert_equal('g?y/./x', url.to_s)
613 url = @base_url.merge('g?y/../x')
614 assert_kind_of(URI::HTTP, url)
615 assert_equal('http://a/b/c/g?y/../x', url.to_s)
616 url = @base_url.route_to('http://a/b/c/g?y/../x')
617 assert_kind_of(URI::Generic, url)
618 assert_equal('g?y/../x', url.to_s)
622 url = @base_url.merge('g#s/./x')
623 assert_kind_of(URI::HTTP, url)
624 assert_equal('http://a/b/c/g#s/./x', url.to_s)
625 url = @base_url.route_to('http://a/b/c/g#s/./x')
626 assert_kind_of(URI::Generic, url)
627 assert_equal('g#s/./x', url.to_s)
631 url = @base_url.merge('g#s/../x')
632 assert_kind_of(URI::HTTP, url)
633 assert_equal('http://a/b/c/g#s/../x', url.to_s)
634 url = @base_url.route_to('http://a/b/c/g#s/../x')
635 assert_kind_of(URI::Generic, url)
636 assert_equal('g#s/../x', url.to_s)
641 url = @base_url.merge('http:g')
642 assert_kind_of(URI::HTTP, url)
643 assert_equal('http:g', url.to_s)
644 url = @base_url.route_to('http:g')
645 assert_kind_of(URI::Generic, url)
646 assert_equal('http:g', url.to_s)