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

Language Ruby Lines 37
MD5 Hash 395143712787ae152c5e151d8b3c15c0 Estimated Cost $538 (why?)
Repository https://bitbucket.org/mediashelf/fedora-migrator View Raw File
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require 'facets/uri'
require 'test/unit'

class TC_Uri < Test::Unit::TestCase

  def test_hash_to_query
    h = { :a=>1, :b=>2 }
    r = URI.hash_to_query(h)
    assert(r == "a=1;b=2" || r == "b=2;a=1")
  end

end


class TC_Kernel < Test::Unit::TestCase

  def test_uri
    assert_equal( uri("abc?xyz"), "abc%3Fxyz" )
  end

  def test_unuri
    assert_equal( unuri("abc%3Fxyz"), "abc?xyz" )
  end

end


class TC_Hash < Test::Unit::TestCase

  def test_to_uri
    h = { :a=>1, :b=>2 }
    r = h.to_uri
    assert(r == "a=1;b=2" || r == "b=2;a=1")
  end

end
Back to Top