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, &filter_block) ⇒ Boolean

Returns:

  • (Boolean)


58
59
60
61
62
63
64
# File 'lib/capybara/rspec/matchers/base.rb', line 58

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

#matches?(actual, &filter_block) ⇒ Boolean

Returns:

  • (Boolean)


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

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