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


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

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

Instance Method Details

#descriptionObject


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

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

#does_not_match?(actual) ⇒ Boolean


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

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

#failure_messageObject


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

def failure_message
  @matcher.failure_message_when_negated
end

#failure_message_when_negatedObject


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

def failure_message_when_negated
  @matcher.failure_message
end

#matches?(actual) ⇒ Boolean


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

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