class RSpecApi::Matchers::Response::Matcher

Attributes

response[RW]

Public Instance Methods

==(response)
Alias for: matches?
description() click to toggle source
# File lib/rspec-api/matchers/response/matcher.rb, line 16
def description
  %Q(be a valid response)
end
failure_message_for_should() click to toggle source
# File lib/rspec-api/matchers/response/matcher.rb, line 20
def failure_message_for_should
  "expected #{match} to #{description}, but got #{actual}"
end
failure_message_for_should_not() click to toggle source
# File lib/rspec-api/matchers/response/matcher.rb, line 24
def failure_message_for_should_not
  "expected #{match} not to #{description}, but got #{actual}"
end
matches?(response) click to toggle source
# File lib/rspec-api/matchers/response/matcher.rb, line 10
def matches?(response)
  @response = response || OpenStruct.new
  status || headers || body
end
Also aliased as: ==

Private Instance Methods

actual() click to toggle source
# File lib/rspec-api/matchers/response/matcher.rb, line 46
def actual
  response
end
body() click to toggle source
# File lib/rspec-api/matchers/response/matcher.rb, line 30
def body
  @body ||= response.body
end
headers() click to toggle source
# File lib/rspec-api/matchers/response/matcher.rb, line 34
def headers
  @headers ||= response.headers
end
match() click to toggle source
# File lib/rspec-api/matchers/response/matcher.rb, line 42
def match
  'response'
end
status() click to toggle source
# File lib/rspec-api/matchers/response/matcher.rb, line 38
def status
  @status ||= response.status
end