@private
# File lib/rspec/expectations/handler.rb, line 5 def self.check_message(msg) unless msg.nil? || msg.respond_to?(:to_str) || msg.respond_to?(:call) ::Kernel.warn [ "WARNING: ignoring the provided expectation message argument (", msg.inspect, ") since it is not a string or a proc." ].join end end
# File lib/rspec/expectations/handler.rb, line 30 def self.handle_failure(matcher, message, failure_message_method) message = message.call if message.respond_to?(:call) message ||= matcher.__send__(failure_message_method) if matcher.respond_to?(:diffable?) && matcher.diffable? ::RSpec::Expectations.fail_with message, matcher.expected, matcher.actual else ::RSpec::Expectations.fail_with message end end
Returns an RSpec-3+ compatible matcher, wrapping a legacy one in an adapter if necessary.
@private
# File lib/rspec/expectations/handler.rb, line 19 def self.modern_matcher_from(matcher) LegacyMacherAdapter::RSpec2.wrap(matcher) || LegacyMacherAdapter::RSpec1.wrap(matcher) || matcher end
Generated with the Darkfish Rdoc Generator 2.