Sha256: 2bd94ebf33712f7701c25b566b7889f0d07e84afdaeb464f058a51ee7621b01d

Contents?: true

Size: 759 Bytes

Versions: 3

Compression:

Stored size: 759 Bytes

Contents

covers 'facets/uri'

test_case URI do

  class_method :query do
    test do
      h = { :a=>1, :b=>2 }
      r = URI.query(h)
      assert(r == "a=1;b=2" || r == "b=2;a=1")
    end
  end

  # this is an alias of the above
  class_method :hash_to_query do
    test do
      h = { :a=>1, :b=>2 }
      r = URI.hash_to_query(h)
      assert(r == "a=1;b=2" || r == "b=2;a=1")
    end
  end

end

test_case Object do

  method :uri do
    test do
      "abc%3Fxyz".assert == uri("abc?xyz")
    end
  end

  method :unuri do
    test do
      "abc?xyz".assert == unuri("abc%3Fxyz")
    end
  end

end

test_case Hash do

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

end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
facets-glimmer-3.2.0 test/standard/test_uri.rb
facets-3.1.0 test/standard/test_uri.rb
facets-3.0.0 test/standard/test_uri.rb