Class: Capybara::RSpecMatchers::Matchers::HaveSibling

Inherits:
WrappedElementMatcher show all
Includes:
CountSugar
Defined in:
lib/capybara/rspec/matchers/have_sibling.rb

Instance Attribute Summary

Attributes inherited from Base

#failure_message, #failure_message_when_negated

Instance Method Summary collapse

Methods included from CountSugar

#at_least, #at_most, #exactly, #once, #thrice, #times, #twice

Methods inherited from WrappedElementMatcher

#does_not_match?, #matches?

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

#descriptionObject


20
21
22
# File 'lib/capybara/rspec/matchers/have_sibling.rb', line 20

def description
  "have sibling #{query.description}"
end

#element_does_not_match?(el) ⇒ Boolean

Returns:

  • (Boolean)

16
17
18
# File 'lib/capybara/rspec/matchers/have_sibling.rb', line 16

def element_does_not_match?(el)
  el.assert_no_sibling(*@args, &@filter_block)
end

#element_matches?(el) ⇒ Boolean

Returns:

  • (Boolean)

12
13
14
# File 'lib/capybara/rspec/matchers/have_sibling.rb', line 12

def element_matches?(el)
  el.assert_sibling(*@args, &@filter_block)
end

#queryObject


24
25
26
# File 'lib/capybara/rspec/matchers/have_sibling.rb', line 24

def query
  @query ||= Capybara::Queries::SiblingQuery.new(*session_query_args, &@filter_block)
end