Sha256: ede3908f0e2720dbdbe365b11d0d7252850f38afb4c3adfe043f0cf4e95ecd21

Contents?: true

Size: 623 Bytes

Versions: 1

Compression:

Stored size: 623 Bytes

Contents

describe String do
  describe '#url_encode' do
    it "escapes all the URL sensitive symbols" do
      "!*'\"();:@&=+$,/?%#[]% ".url_encode.should == "!*'%22();:@&=+$,/?%25%23%5B%5D%25%20"
    end

    it "doesn't touch normal characters" do
      "Hello World".url_encode.should == "Hello%20World"
    end
  end

  describe '#url_decode' do
    it "converts an url encoded string back to normality" do
      "!*'%22();:@&=+$,/?%25%23%5B%5D%25%20".url_decode.should == "!*'\"();:@&=+$,/?%#[]% "
    end

    it "doesn't break normal characters" do
      "Hello%20World".url_decode.should == "Hello World"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
under-os-http-1.4.0 spec/core/string_spec.rb