Class: Capybara::RSpecMatchers::Matchers::NegatedMatcher

Inherits:
Object
  • Object
show all
Includes:
Compound
Defined in:
lib/capybara/rspec/matchers/base.rb

Instance Method Summary collapse

Methods included from Compound

#and, #and_then, #or

Constructor Details

#initialize(matcher) ⇒ NegatedMatcher

Returns a new instance of NegatedMatcher.



86
87
88
89
# File 'lib/capybara/rspec/matchers/base.rb', line 86

def initialize(matcher)
  super()
  @matcher = matcher
end

Instance Method Details

#descriptionObject



99
100
101
# File 'lib/capybara/rspec/matchers/base.rb', line 99

def description
  "not #{@matcher.description}"
end

#does_not_match?(actual, &filter_block) ⇒ Boolean

Returns:

  • (Boolean)


95
96
97
# File 'lib/capybara/rspec/matchers/base.rb', line 95

def does_not_match?(actual, &filter_block)
  @matcher.matches?(actual, &filter_block)
end

#failure_messageObject



103
104
105
# File 'lib/capybara/rspec/matchers/base.rb', line 103

def failure_message
  @matcher.failure_message_when_negated
end

#failure_message_when_negatedObject



107
108
109
# File 'lib/capybara/rspec/matchers/base.rb', line 107

def failure_message_when_negated
  @matcher.failure_message
end

#matches?(actual, &filter_block) ⇒ Boolean

Returns:

  • (Boolean)


91
92
93
# File 'lib/capybara/rspec/matchers/base.rb', line 91

def matches?(actual, &filter_block)
  @matcher.does_not_match?(actual, &filter_block)
end