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.



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

def initialize(matcher)
  @matcher = matcher
end

Instance Method Details

#descriptionObject



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

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

#does_not_match?(actual) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#failure_messageObject



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

def failure_message
  @matcher.failure_message_when_negated
end

#failure_message_when_negatedObject



227
228
229
# File 'lib/capybara/rspec/matchers.rb', line 227

def failure_message_when_negated
  @matcher.failure_message
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


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

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