Class: RSpec::Expectations::NegativeExpectationHandler
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/handler.rb
Class Method Summary collapse
- .does_not_match?(matcher, actual, &block) ⇒ Boolean
- .handle_matcher(actual, initial_matcher, custom_message = nil, &block) ⇒ Object
- .opposite_should_method ⇒ Object
- .should_method ⇒ Object
- .verb ⇒ Object
Class Method Details
.does_not_match?(matcher, actual, &block) ⇒ Boolean
88 89 90 91 92 93 94 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/handler.rb', line 88 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) ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/handler.rb', line 75 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[:message] = end negated_match_result || ExpectationHelper.handle_failure(matcher, , :failure_message_when_negated) end end |
.opposite_should_method ⇒ Object
104 105 106 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/handler.rb', line 104 def self.opposite_should_method :should end |
.should_method ⇒ Object
100 101 102 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/handler.rb', line 100 def self.should_method :should_not end |
.verb ⇒ Object
96 97 98 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/handler.rb', line 96 def self.verb 'is expected not to' end |