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.
91 92 93 94 95 96 97 98 99 |
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 91 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.
117 118 119 |
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 117 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.
107 108 109 110 111 112 113 114 115 |
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 107 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.
121 122 123 |
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 121 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.
125 126 127 |
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 125 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.
101 102 103 104 105 |
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 101 def matches?(scope) @scope = Internal::ScopeResolution.resolve(scope) @matched = find_matches(@scope) count_ok?(@matched.size) end |