Class: Katalyst::Kpop::Matchers::CapybaraMatcher Private
- Inherits:
-
Base
- Object
- RSpec::Rails::Matchers::BaseMatcher
- Base
- Katalyst::Kpop::Matchers::CapybaraMatcher
- Defined in:
- lib/katalyst/kpop/matchers/capybara_matcher.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Direct Known Subclasses
Instance Attribute Summary collapse
- #matched ⇒ Object readonly private
Instance Method Summary collapse
- #describe_actual ⇒ Object private
- #describe_expected ⇒ Object private
- #description ⇒ Object private
- #failure_message ⇒ Object private
- #failure_message_when_negated ⇒ Object private
- #match(expected, actual) ⇒ Object private
- #matches?(actual) ⇒ Boolean private
Instance Attribute Details
#matched ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/katalyst/kpop/matchers/capybara_matcher.rb', line 10 def matched @matched end |
Instance Method Details
#describe_actual ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 33 34 |
# File 'lib/katalyst/kpop/matchers/capybara_matcher.rb', line 30 def describe_actual response = actual.native.children.to_html.gsub(/\s+/, " ") response = "#{response[0..120]}..." if response.length > 120 response.inspect end |
#describe_expected ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/katalyst/kpop/matchers/capybara_matcher.rb', line 26 def describe_expected expected.inspect end |
#description ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 |
# File 'lib/katalyst/kpop/matchers/capybara_matcher.rb', line 22 def description "match #{expected}" end |
#failure_message ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
36 37 38 |
# File 'lib/katalyst/kpop/matchers/capybara_matcher.rb', line 36 def "expected #{describe_expected} but received #{describe_actual} instead" end |
#failure_message_when_negated ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
40 41 42 |
# File 'lib/katalyst/kpop/matchers/capybara_matcher.rb', line 40 def "expected not to find #{expected}" end |
#match(expected, actual) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 |
# File 'lib/katalyst/kpop/matchers/capybara_matcher.rb', line 18 def match(expected, actual) actual.find(expected) end |
#matches?(actual) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 15 16 |
# File 'lib/katalyst/kpop/matchers/capybara_matcher.rb', line 12 def matches?(actual) super rescue ::::ElementNotFound nil end |