class RSpecApi::Matchers::ContentType::Matcher

Attributes

content_type[RW]

Public Class Methods

new(content_type) click to toggle source
# File lib/rspec-api/matchers/content_type/matcher.rb, line 9
def initialize(content_type)
  @content_type = content_type
end

Public Instance Methods

description() click to toggle source
# File lib/rspec-api/matchers/content_type/matcher.rb, line 17
def description
  %Q{include 'Content-Type': '#{content_type}'}
end
matches?(response) click to toggle source
Calls superclass method
# File lib/rspec-api/matchers/content_type/matcher.rb, line 13
def matches?(response)
  super && headers.key?('Content-Type') && content_type.match(headers['Content-Type'])
end