Class: RSpecHTML::Matchers::ContainTag
- Inherits:
-
Object
- Object
- RSpecHTML::Matchers::ContainTag
- Defined in:
- lib/rspec_html/matchers/contain_tag.rb
Overview
Matches elements within a given DOM element.
Instance Attribute Summary
Attributes included from Base
Instance Method Summary collapse
Methods included from Countable
#at_least, #at_most, #once, #times, #twice
Methods included from Base
#description, #failure_message, included, #initialize, #pluralize, #reconstituted, #save_actual
Instance Method Details
#match(actual, expected_count:, expected_count_type:) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/rspec_html/matchers/contain_tag.rb', line 10 def match(actual, expected_count:, expected_count_type:) @actual = actual @expected_count = expected_count @expected_count_type = expected_count_type return actual.public_send(@expected, ).present? if @expected_count.nil? @actual_count = actual.public_send(@expected, ).size count_match? end |