PageRenderTime 41ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/gems/facets-2.4.5/test/more/test_uri.rb

https://bitbucket.org/mediashelf/fedora-migrator
Ruby | 36 lines | 24 code | 12 blank | 0 comment | 6 complexity | 395143712787ae152c5e151d8b3c15c0 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
  1. require 'facets/uri'
  2. require 'test/unit'
  3. class TC_Uri < Test::Unit::TestCase
  4. def test_hash_to_query
  5. h = { :a=>1, :b=>2 }
  6. r = URI.hash_to_query(h)
  7. assert(r == "a=1;b=2" || r == "b=2;a=1")
  8. end
  9. end
  10. class TC_Kernel < Test::Unit::TestCase
  11. def test_uri
  12. assert_equal( uri("abc?xyz"), "abc%3Fxyz" )
  13. end
  14. def test_unuri
  15. assert_equal( unuri("abc%3Fxyz"), "abc?xyz" )
  16. end
  17. end
  18. class TC_Hash < Test::Unit::TestCase
  19. def test_to_uri
  20. h = { :a=>1, :b=>2 }
  21. r = h.to_uri
  22. assert(r == "a=1;b=2" || r == "b=2;a=1")
  23. end
  24. end