123456789_123456789_123456789_123456789_123456789_

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

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Base
Instance Chain:
self, Base, Compound, RSpec::Matchers::Composable
Inherits: Capybara::RSpecMatchers::Matchers::Base
Defined in: lib/capybara/rspec/matchers/base.rb

Class Method Summary

Base - Inherited

Instance Attribute Summary

Instance Method Summary

Constructor Details

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

Instance Method Details

#does_not_match?(actual, &filter_block) ⇒ Boolean

[ GitHub ]

  
# 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

[ GitHub ]

  
# 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

#wrap(actual) (private)

[ GitHub ]

  
# File 'lib/capybara/rspec/matchers/base.rb', line 68

def wrap(actual)
  actual = actual.to_capybara_node if actual.respond_to?(:to_capybara_node)
  @context_el = if actual.respond_to?(:has_selector?)
    actual
  else
    Capybara.string(actual.to_s)
  end
end