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.



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

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

Instance Method Details

#descriptionObject



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

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

#does_not_match?(actual) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#failure_messageObject



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

def failure_message
  @matcher.failure_message_when_negated
end

#failure_message_when_negatedObject



97
98
99
# File 'lib/capybara/rspec/matchers/base.rb', line 97

def failure_message_when_negated
  @matcher.failure_message
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


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

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