Class: Capybara::RSpecMatchers::Matchers::WrappedElementMatcher

Inherits:
Base
  • Object
show all
Defined in:
lib/capybara/rspec/matchers/base.rb

Instance Attribute Summary

Attributes inherited from Base

#failure_message, #failure_message_when_negated

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Compound

#and, #and_then, #or

Constructor Details

This class inherits a constructor from Capybara::RSpecMatchers::Matchers::Base

Instance Method Details

#does_not_match?(actual) ⇒ Boolean

Returns:

  • (Boolean)


49
50
51
52
53
54
# File 'lib/capybara/rspec/matchers/base.rb', line 49

def does_not_match?(actual)
  element_does_not_match?(wrap(actual))
rescue Capybara::ExpectationNotMet => e
  @failure_message_when_negated = e.message
  false
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
45
46
47
# File 'lib/capybara/rspec/matchers/base.rb', line 42

def matches?(actual)
  element_matches?(wrap(actual))
rescue Capybara::ExpectationNotMet => e
  @failure_message = e.message
  false
end