Class: RSpec::Expectations::NegativeExpectationHandler Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | rspec-expectations/lib/rspec/expectations/handler.rb |
Class Method Summary
- .does_not_match?(matcher, actual, &block) ⇒ Boolean Internal use only
- .handle_matcher(actual, initial_matcher, custom_message = nil, &block) Internal use only
- .opposite_should_method Internal use only
- .should_method Internal use only
- .verb Internal use only
Class Method Details
.does_not_match?(matcher, actual, &block) ⇒ Boolean
# File 'rspec-expectations/lib/rspec/expectations/handler.rb', line 87
def self.does_not_match?(matcher, actual, &block) if matcher.respond_to?(:does_not_match?) matcher.does_not_match?(actual, &block) else !matcher.matches?(actual, &block) end end
.handle_matcher(actual, initial_matcher, custom_message = nil, &block)
[ GitHub ]# File 'rspec-expectations/lib/rspec/expectations/handler.rb', line 74
def self.handle_matcher(actual, initial_matcher, =nil, &block) ExpectationHelper.with_matcher(self, initial_matcher, ) do |matcher| return ::RSpec::Matchers::BuiltIn::NegativeOperatorMatcher.new(actual) unless initial_matcher negated_match_result = does_not_match?(matcher, actual, &block) if && negated_match_result.respond_to?(:error_generator) negated_match_result.error_generator.opts[: ] = end negated_match_result || ExpectationHelper.handle_failure(matcher, , : ) end end
.opposite_should_method
[ GitHub ]# File 'rspec-expectations/lib/rspec/expectations/handler.rb', line 103
def self.opposite_should_method :should end
.should_method
[ GitHub ]# File 'rspec-expectations/lib/rspec/expectations/handler.rb', line 99
def self.should_method :should_not end
.verb
[ GitHub ]# File 'rspec-expectations/lib/rspec/expectations/handler.rb', line 95
def self.verb 'is expected not to' end