Sha256: 7191c63511a601ac9d756956ad7dc0284404a1110be71234904431ab9e1f0112

Contents?: true

Size: 560 Bytes

Versions: 5

Compression:

Stored size: 560 Bytes

Contents

RSpec::Matchers.define :respond_a_record do
  match do |actual|
    JSON::parse(actual.browser.last_response.body).class == Hash
  end
  description do
    "respond with a record (Hash)"
  end
  failure_message do |actual|
    "expected #{actual} response body would be a record \nneed : Hash, \ngot  : #{JSON::parse(actual.browser.last_response.body).class}"
  end
  failure_message_when_negated do |actual|
    "expected #{actual} response body would not be a record \nneed : Hash, \ngot  : #{JSON::parse(actual.browser.last_response.body).class}"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rack-rest-rspec-0.0.4 lib/rack-rest-rspec/matchers/respond_a_record.rb
rack-rest-rspec-0.0.3 lib/rack-rest-rspec/matchers/respond_a_record.rb
rack-rest-rspec-0.0.2 lib/rack-rest-rspec/matchers/respond_a_record.rb
rack-rest-rspec-0.0.1 lib/rack-rest-rspec/matchers/respond_a_record.rb
rack-rest-rspec-0.0.1a lib/rack-rest-rspec/matchers/respond_a_record.rb