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.
8 9 10 |
# File 'lib/katalyst/kpop/matchers/capybara_matcher.rb', line 8 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.
28 29 30 31 32 |
# File 'lib/katalyst/kpop/matchers/capybara_matcher.rb', line 28 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.
24 25 26 |
# File 'lib/katalyst/kpop/matchers/capybara_matcher.rb', line 24 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.
20 21 22 |
# File 'lib/katalyst/kpop/matchers/capybara_matcher.rb', line 20 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.
34 35 36 |
# File 'lib/katalyst/kpop/matchers/capybara_matcher.rb', line 34 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.
38 39 40 |
# File 'lib/katalyst/kpop/matchers/capybara_matcher.rb', line 38 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.
16 17 18 |
# File 'lib/katalyst/kpop/matchers/capybara_matcher.rb', line 16 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.
10 11 12 13 14 |
# File 'lib/katalyst/kpop/matchers/capybara_matcher.rb', line 10 def matches?(actual) super rescue ::Capybara::ElementNotFound nil end |