Sha256: 33bac571791aa7566a83cfe801aa03cda0a46c56c9eae96aa9a648244a16f0fe
Contents?: true
Size: 938 Bytes
Versions: 17
Compression:
Stored size: 938 Bytes
Contents
module RSpec module Matchers module BuiltIn # @api private # Provides the implementation for `match`. # Not intended to be instantiated directly. class Match < BaseMatcher # @api private # @return [String] def description "match #{surface_descriptions_in(expected).inspect}" end # @api private # @return [Boolean] def diffable? true end private def match(expected, actual) return true if values_match?(expected, actual) return false unless can_safely_call_match?(expected, actual) actual.match(expected) end def can_safely_call_match?(expected, actual) return false unless actual.respond_to?(:match) !(RSpec::Matchers.is_a_matcher?(expected) && (String === actual || Regexp === actual)) end end end end end
Version data entries
17 entries across 17 versions & 9 rubygems