Class: Dommy::RSpec::CapyStyleMatchers::Base Private
- Inherits:
-
Object
- Object
- Dommy::RSpec::CapyStyleMatchers::Base
- Defined in:
- lib/dommy/rspec/capy_style_matchers.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 Method Summary collapse
- #description ⇒ Object private
- #does_not_match?(scope) ⇒ Boolean private
- #failure_message ⇒ Object private
- #failure_message_when_negated ⇒ Object private
-
#initialize(selector, **opts) ⇒ Base
constructor
private
A new instance of Base.
- #matches?(scope) ⇒ Boolean private
Constructor Details
#initialize(selector, **opts) ⇒ Base
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.
Returns a new instance of Base.
83 84 85 86 87 88 89 90 91 |
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 83 def initialize(selector, **opts) @selector = selector @text = opts[:text] || opts[:content] @count = opts[:count] @exact = opts[:exact] || opts[:exact_text] @visible = opts.fetch(:visible, :visible) # :wait is accepted for Capybara compatibility but ignored # (Dommy is synchronous). end |
Instance Method Details
#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.
109 110 111 |
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 109 def description "have #{describe_target}" end |
#does_not_match?(scope) ⇒ 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.
99 100 101 102 103 104 105 106 107 |
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 99 def does_not_match?(scope) @scope = Internal::ScopeResolution.resolve(scope) @matched = find_matches(@scope) if @count !count_ok?(@matched.size) else @matched.empty? end 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.
113 114 115 |
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 113 def "expected to find #{describe_target}, found #{@matched.size}" 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.
117 118 119 |
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 117 def "expected NOT to find #{describe_target}, found #{@matched.size}" end |
#matches?(scope) ⇒ 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.
93 94 95 96 97 |
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 93 def matches?(scope) @scope = Internal::ScopeResolution.resolve(scope) @matched = find_matches(@scope) count_ok?(@matched.size) end |