Class: Capybara::RSpecMatchers::HaveSelector
- Inherits:
-
Matcher
- Object
- Matcher
- Capybara::RSpecMatchers::HaveSelector
show all
- Defined in:
- lib/capybara/rspec/matchers.rb
Instance Attribute Summary
Attributes inherited from Matcher
#failure_message, #failure_message_when_negated
Instance Method Summary
collapse
Methods inherited from Matcher
#wrap
Methods included from Compound
#and, #and_then, #or
Constructor Details
#initialize(*args, &filter_block) ⇒ HaveSelector
Returns a new instance of HaveSelector.
60
61
62
63
|
# File 'lib/capybara/rspec/matchers.rb', line 60
def initialize(*args, &filter_block)
@args = args
@filter_block = filter_block
end
|
Instance Method Details
#description ⇒ Object
73
74
75
|
# File 'lib/capybara/rspec/matchers.rb', line 73
def description
"have #{query.description}"
end
|
#does_not_match?(actual) ⇒ Boolean
69
70
71
|
# File 'lib/capybara/rspec/matchers.rb', line 69
def does_not_match?(actual)
wrap_does_not_match?(actual) { |el| el.assert_no_selector(*@args, &@filter_block) }
end
|
#matches?(actual) ⇒ Boolean
65
66
67
|
# File 'lib/capybara/rspec/matchers.rb', line 65
def matches?(actual)
wrap_matches?(actual) { |el| el.assert_selector(*@args, &@filter_block) }
end
|
#query ⇒ Object
77
78
79
|
# File 'lib/capybara/rspec/matchers.rb', line 77
def query
@query ||= Capybara::Queries::SelectorQuery.new(*session_query_args, &@filter_block)
end
|