Class: Capybara::RSpecMatchers::MatchSelector
- Defined in:
- lib/capybara/rspec/matchers.rb
Instance Attribute Summary collapse
-
#failure_message ⇒ Object
(also: #failure_message_for_should)
readonly
Returns the value of attribute failure_message.
-
#failure_message_when_negated ⇒ Object
(also: #failure_message_for_should_not)
readonly
Returns the value of attribute failure_message_when_negated.
Instance Method Summary collapse
- #description ⇒ Object
- #does_not_match?(actual) ⇒ Boolean
-
#initialize(*args) ⇒ MatchSelector
constructor
A new instance of MatchSelector.
- #matches?(actual) ⇒ Boolean
- #query ⇒ Object
Methods inherited from Matcher
Constructor Details
#initialize(*args) ⇒ MatchSelector
Returns a new instance of MatchSelector.
193 194 195 |
# File 'lib/capybara/rspec/matchers.rb', line 193 def initialize(*args) @args = args end |
Instance Attribute Details
#failure_message ⇒ Object (readonly) Also known as: failure_message_for_should
Returns the value of attribute failure_message.
191 192 193 |
# File 'lib/capybara/rspec/matchers.rb', line 191 def @failure_message end |
#failure_message_when_negated ⇒ Object (readonly) Also known as: failure_message_for_should_not
Returns the value of attribute failure_message_when_negated.
191 192 193 |
# File 'lib/capybara/rspec/matchers.rb', line 191 def @failure_message_when_negated end |
Instance Method Details
#description ⇒ Object
211 212 213 |
# File 'lib/capybara/rspec/matchers.rb', line 211 def description "match #{query.description}" end |
#does_not_match?(actual) ⇒ Boolean
204 205 206 207 208 209 |
# File 'lib/capybara/rspec/matchers.rb', line 204 def does_not_match?(actual) actual.assert_not_matches_selector(*@args) rescue Capybara::ExpectationNotMet => e @failure_message_when_negated = e. return false end |
#matches?(actual) ⇒ Boolean
197 198 199 200 201 202 |
# File 'lib/capybara/rspec/matchers.rb', line 197 def matches?(actual) actual.assert_matches_selector(*@args) rescue Capybara::ExpectationNotMet => e @failure_message = e. return false end |
#query ⇒ Object
215 216 217 |
# File 'lib/capybara/rspec/matchers.rb', line 215 def query @query ||= Capybara::Queries::MatchQuery.new(*@args) end |