Sha256: f3ffc87ed7757abe70d72ba9d39bb39b18a3cf10705d3376126a0978e1bac7a4
Contents?: true
Size: 554 Bytes
Versions: 21
Compression:
Stored size: 554 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| expect(actual).to be_an(HTTPI::Response) expect(actual.code).to eq(response[:code]) expect(downcase(actual.headers)).to eq(downcase(response[:headers])) expect(actual.body).to eq(response[:body]) end def downcase(hash) hash.inject({}) do |memo, (key, value)| memo[key.downcase] = value.downcase memo end end end
Version data entries
21 entries across 21 versions & 1 rubygems