Class: RSpec::Matchers::AliasedNegatedMatcher

Inherits:
AliasedMatcher show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/aliased_matcher.rb

Instance Attribute Summary

Attributes inherited from MatcherDelegator

#base_matcher

Instance Method Summary collapse

Methods inherited from AliasedMatcher

#description, #initialize, #method_missing

Methods inherited from MatcherDelegator

#initialize, #initialize_copy, #method_missing, #respond_to?, #respond_to_missing?

Methods included from Composable

#===, #and, #description_of, #or, should_enumerate?, surface_descriptions_in, unreadable_io?, #values_match?

Constructor Details

This class inherits a constructor from RSpec::Matchers::AliasedMatcher

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RSpec::Matchers::AliasedMatcher

Instance Method Details

#does_not_match?(*args, &block) ⇒ Boolean

Returns:

  • (Boolean)


80
81
82
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/aliased_matcher.rb', line 80

def does_not_match?(*args, &block)
  @base_matcher.matches?(*args, &block)
end

#failure_messageObject



84
85
86
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/aliased_matcher.rb', line 84

def failure_message
  optimal_failure_message(__method__, :failure_message_when_negated)
end

#failure_message_when_negatedObject



88
89
90
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/aliased_matcher.rb', line 88

def failure_message_when_negated
  optimal_failure_message(__method__, :failure_message)
end

#matches?(*args, &block) ⇒ Boolean

Returns:

  • (Boolean)


72
73
74
75
76
77
78
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/aliased_matcher.rb', line 72

def matches?(*args, &block)
  if @base_matcher.respond_to?(:does_not_match?)
    @base_matcher.does_not_match?(*args, &block)
  else
    !super
  end
end