Class: Capybara::RSpecMatchers::NegatedMatcher

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

Instance Method Summary collapse

Methods included from Compound

#and, #and_then, #or

Constructor Details

#initialize(matcher) ⇒ NegatedMatcher

Returns a new instance of NegatedMatcher.



203
204
205
# File 'lib/capybara/rspec/matchers.rb', line 203

def initialize(matcher)
  @matcher = matcher
end

Instance Method Details

#descriptionObject



215
216
217
# File 'lib/capybara/rspec/matchers.rb', line 215

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

#does_not_match?(actual) ⇒ Boolean

Returns:

  • (Boolean)


211
212
213
# File 'lib/capybara/rspec/matchers.rb', line 211

def does_not_match?(actual)
  @matcher.matches?(actual)
end

#failure_messageObject



219
220
221
# File 'lib/capybara/rspec/matchers.rb', line 219

def failure_message
  @matcher.failure_message_when_negated
end

#failure_message_when_negatedObject



223
224
225
# File 'lib/capybara/rspec/matchers.rb', line 223

def failure_message_when_negated
  @matcher.failure_message
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


207
208
209
# File 'lib/capybara/rspec/matchers.rb', line 207

def matches?(actual)
  @matcher.does_not_match?(actual)
end