Sha256: e942feef555a9c2dd1becac5891deb15ee18c35243039b38733d88917135da95

Contents?: true

Size: 770 Bytes

Versions: 3

Compression:

Stored size: 770 Bytes

Contents

require File.expand_path("../spec_helper", File.dirname(__FILE__))

describe StreamlyFFI::PersistentRequest do
  context 'escape method' do
    before(:all) do
      @connection = StreamlyFFI.connect
    end

    it 'should escape properly' do
      @connection.escape('+').should == '%2B'
      @connection.escape('This is a test').should == 'This%20is%20a%20test'
      @connection.escape('<>/\\').should == '%3C%3E%2F%5C'
      @connection.escape('"').should == '%22'
      @connection.escape(':').should == '%3A'
    end

    it 'should escape brackets' do
      @connection.escape('{').should == '%7B'
      @connection.escape('}').should == '%7D'
    end

    it 'should escape exclamation marks!' do
      @connection.escape('!').should == '%21'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
streamly_ffi-0.2.6 spec/streamly_ffi/persistent_request_spec.rb
streamly_ffi-0.2.4 spec/streamly_ffi/persistent_request_spec.rb
streamly_ffi-0.2.3 spec/streamly_ffi/persistent_request_spec.rb