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


71
72
73
74
# File 'lib/capybara/rspec/matchers/base.rb', line 71

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

Instance Method Details

#descriptionObject


84
85
86
# File 'lib/capybara/rspec/matchers/base.rb', line 84

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

#does_not_match?(actual) ⇒ Boolean

Returns:

  • (Boolean)

80
81
82
# File 'lib/capybara/rspec/matchers/base.rb', line 80

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

#failure_messageObject


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

def failure_message
  @matcher.failure_message_when_negated
end

#failure_message_when_negatedObject


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

def failure_message_when_negated
  @matcher.failure_message
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)

76
77
78
# File 'lib/capybara/rspec/matchers/base.rb', line 76

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