Class: Dommy::Rails::RSpec::Matchers::HaveMeta
- Inherits:
-
Object
- Object
- Dommy::Rails::RSpec::Matchers::HaveMeta
- Defined in:
- lib/dommy/rails/rspec/matchers.rb
Instance Method Summary collapse
- #description ⇒ Object
- #does_not_match?(actual) ⇒ Boolean
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(name:, property:, content:) ⇒ HaveMeta
constructor
A new instance of HaveMeta.
- #matches?(actual) ⇒ Boolean
Constructor Details
#initialize(name:, property:, content:) ⇒ HaveMeta
Returns a new instance of HaveMeta.
249 250 251 252 253 |
# File 'lib/dommy/rails/rspec/matchers.rb', line 249 def initialize(name:, property:, content:) @name = name @property = property @content = content end |
Instance Method Details
#description ⇒ Object
263 264 265 |
# File 'lib/dommy/rails/rspec/matchers.rb', line 263 def description "have meta #{criteria_description}" end |
#does_not_match?(actual) ⇒ Boolean
259 260 261 |
# File 'lib/dommy/rails/rspec/matchers.rb', line 259 def does_not_match?(actual) !matches?(actual) end |
#failure_message ⇒ Object
267 268 269 |
# File 'lib/dommy/rails/rspec/matchers.rb', line 267 def "expected to find meta #{criteria_description}" end |
#failure_message_when_negated ⇒ Object
271 272 273 |
# File 'lib/dommy/rails/rspec/matchers.rb', line 271 def "expected not to find meta #{criteria_description}" end |
#matches?(actual) ⇒ Boolean
255 256 257 |
# File 'lib/dommy/rails/rspec/matchers.rb', line 255 def matches?(actual) Dommy::Rails::PageInspector.(MatchTarget.document(actual), name: @name, property: @property, content: @content) end |