Class: Capybara::RSpecMatchers::HaveSelector
- Inherits:
-
Object
- Object
- Capybara::RSpecMatchers::HaveSelector
- Defined in:
- lib/capybara/rspec/matchers.rb
Instance Method Summary collapse
- #description ⇒ Object
- #does_not_match?(actual) ⇒ Boolean
- #failure_message_for_should ⇒ Object
- #failure_message_for_should_not ⇒ Object
-
#initialize(*args) ⇒ HaveSelector
constructor
A new instance of HaveSelector.
- #matches?(actual) ⇒ Boolean
- #query ⇒ Object
- #wrap(actual) ⇒ Object
Constructor Details
#initialize(*args) ⇒ HaveSelector
Returns a new instance of HaveSelector.
4 5 6 |
# File 'lib/capybara/rspec/matchers.rb', line 4 def initialize(*args) @args = args end |
Instance Method Details
#description ⇒ Object
26 27 28 |
# File 'lib/capybara/rspec/matchers.rb', line 26 def description "has #{query.description}" end |
#does_not_match?(actual) ⇒ Boolean
13 14 15 16 |
# File 'lib/capybara/rspec/matchers.rb', line 13 def does_not_match?(actual) @actual = wrap(actual) @actual.has_no_selector?(*@args) end |
#failure_message_for_should ⇒ Object
18 19 20 |
# File 'lib/capybara/rspec/matchers.rb', line 18 def query.(:assert, @actual) end |
#failure_message_for_should_not ⇒ Object
22 23 24 |
# File 'lib/capybara/rspec/matchers.rb', line 22 def query.(:assert, @actual) end |
#matches?(actual) ⇒ Boolean
8 9 10 11 |
# File 'lib/capybara/rspec/matchers.rb', line 8 def matches?(actual) @actual = wrap(actual) @actual.has_selector?(*@args) end |