Sha256: 8585145e08dc0d4c680ae4d608cbf6873860bc86db494cc029fdf9d64628396f
Contents?: true
Size: 926 Bytes
Versions: 6
Compression:
Stored size: 926 Bytes
Contents
module InfinumJsonApiSetup module RSpec module Matchers # @param [String] pointer # @return [InfinumJsonApiSetup::Rspec::Matchers::HaveErrorPointer] def have_error_pointer(pointer) # rubocop:disable Naming/PredicateName HaveErrorPointer.new(pointer) end class HaveErrorPointer < JsonBodyMatcher # @param [String] pointer def initialize(pointer) super(Matchers::Util::BodyParser.new('errors')) @pointer = pointer end private attr_reader :pointer attr_reader :errors def body_matches? errors.any? { |error| error.dig('source', 'pointer') == pointer } end def match_failure_message "Expected error pointers to include '#{pointer}', but didn't" end def process_parsing_result(result) @errors = result end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems