Class: Dommy::RSpec::Matchers::ContainDomText Private
- Inherits:
-
Object
- Object
- Dommy::RSpec::Matchers::ContainDomText
- Defined in:
- lib/dommy/rspec/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.
Instance Method Summary collapse
- #description ⇒ Object private
- #does_not_match?(scope) ⇒ Boolean private
- #failure_message ⇒ Object private
- #failure_message_when_negated ⇒ Object private
-
#initialize(text) ⇒ ContainDomText
constructor
private
A new instance of ContainDomText.
- #matches?(scope) ⇒ Boolean private
Constructor Details
#initialize(text) ⇒ ContainDomText
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 ContainDomText.
93 94 95 |
# File 'lib/dommy/rspec/matchers.rb', line 93 def initialize(text) @text = text 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.
107 108 109 |
# File 'lib/dommy/rspec/matchers.rb', line 107 def description "contain text #{@text.inspect}" 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.
103 104 105 |
# File 'lib/dommy/rspec/matchers.rb', line 103 def does_not_match?(scope) !matches?(scope) 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.
111 112 113 |
# File 'lib/dommy/rspec/matchers.rb', line 111 def "expected text to include #{@text.inspect}, got #{@actual_text.inspect}" 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.
115 116 117 |
# File 'lib/dommy/rspec/matchers.rb', line 115 def "expected text not to include #{@text.inspect}, got #{@actual_text.inspect}" 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.
97 98 99 100 101 |
# File 'lib/dommy/rspec/matchers.rb', line 97 def matches?(scope) @scope = Internal::ScopeResolution.resolve(scope) @actual_text = Internal::DomMatching.text_of(@scope) Internal::DomMatching.text_matches?(@actual_text, @text) end |