Sha256: e6384f5d70245027136d4ededdb5bdbcb37c0bf01037eeeecaa4d3be5594b77d

Contents?: true

Size: 612 Bytes

Versions: 3

Compression:

Stored size: 612 Bytes

Contents

module APIMatchers
  module Headers
    class BeJSON < Base
      def expected_content_type
        'application/json; charset=utf-8'
      end

      def failure_message
        %Q{expected a JSON response with '#{expected_content_type}'. Got: '#{content_type_response}'.}
      end

      def failure_message_when_negated
        %Q{expected to not be a JSON response. Got: '#{expected_content_type}'.}
      end

      # RSpec 2 compatibility:
      alias_method :failure_message_for_should, :failure_message
      alias_method :failure_message_for_should_not, :failure_message_when_negated
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
api_matchers-0.6.0 lib/api_matchers/headers/be_json.rb
api_matchers-0.5.1 lib/api_matchers/headers/be_json.rb
api_matchers-0.5.0 lib/api_matchers/headers/be_json.rb