Sha256: 4b867170a2b8ec2fa251330d666f05237f3975eaaddff9cd169827cb4ff88113

Contents?: true

Size: 569 Bytes

Versions: 6

Compression:

Stored size: 569 Bytes

Contents

# frozen_string_literal: true

module RSpecHTML
  module Matchers
    # Matches elements within a given DOM element.
    class ContainTag
      include Base
      include Countable

      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, @options).present? if @expected_count.nil?

        @actual_count = actual.public_send(@expected, @options).size
        count_match?
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rspec-html-0.3.5 lib/rspec_html/matchers/contain_tag.rb
rspec-html-0.3.4 lib/rspec_html/matchers/contain_tag.rb
rspec-html-0.3.3 lib/rspec_html/matchers/contain_tag.rb
rspec-html-0.3.2 lib/rspec_html/matchers/contain_tag.rb
rspec-html-0.3.1 lib/rspec_html/matchers/contain_tag.rb
rspec-html-0.3.0 lib/rspec_html/matchers/contain_tag.rb