Sha256: 98aa4e77765eac53f53c95219701e50c6b251b0d237a6b814442221ea313f0a5

Contents?: true

Size: 535 Bytes

Versions: 20

Compression:

Stored size: 535 Bytes

Contents

RSpec::Matchers.define :match_response do |options|
  defaults = { :code => 200, :headers => { "Accept-encoding" => "utf-8" }, :body => "" }
  response = defaults.merge options

  match do |actual|
    actual.should be_an(HTTPI::Response)
    actual.code.should == response[:code]
    downcase(actual.headers).should == downcase(response[:headers])
    actual.body.should == response[:body]
  end

  def downcase(hash)
    hash.inject({}) do |memo, (key, value)|
      memo[key.downcase] = value.downcase
      memo
    end
  end

end

Version data entries

20 entries across 20 versions & 6 rubygems

Version Path
httpi-2.1.1 spec/support/matchers.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/httpi-0.9.7/spec/support/matchers.rb
httpi-2.1.0 spec/support/matchers.rb
httpi-2.0.2 spec/support/matchers.rb
httpi-2.0.1 spec/support/matchers.rb
httpi-2.0.0 spec/support/matchers.rb
httpi-2.0.0.rc1 spec/support/matchers.rb
httpi-1.1.1 spec/support/matchers.rb
httpi-1.1.0 spec/support/matchers.rb
httpi-1.0.0 spec/support/matchers.rb
httpi-0.9.7 spec/support/matchers.rb
httpi-0.9.6 spec/support/matchers.rb
regenersis-httpi-0.9.6 spec/support/matchers.rb
cs-httpi-0.9.5.2 spec/support/matchers.rb
cs-httpi-0.9.5.1 spec/support/matchers.rb
httpi-ntlm-0.9.6 spec/support/matchers.rb
httpi-0.9.5 spec/support/matchers.rb
search_biomodel-1.0.0 search_biomodel/ruby/1.8/gems/httpi-0.9.4/spec/support/matchers.rb
httpi-0.9.4 spec/support/matchers.rb
httpi-0.9.3 spec/support/matchers.rb