Sha256: 6986e8f78b414fb5cf6dbdf431b49302cc661ca47cbd8cf3c094031cae6d6812

Contents?: true

Size: 507 Bytes

Versions: 13

Compression:

Stored size: 507 Bytes

Contents

# frozen_string_literal: true

module RSpecHTML
  module Matchers
    # Matches text within a given DOM element (strips HTML tags and compares text content only).
    # (Deprecated in favour of `#match_text`.
    class ContainText
      include Base

      diffable

      def match(actual)
        warn('[rspec-html] The `contain_text` matcher is deprecated. Use `match_text` instead.')
        @rspec_actual = actual&.text
        (actual&.text || '').include?(@expected.to_s)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rspec-html-0.2.20 lib/rspec_html/matchers/contain_text.rb
rspec-html-0.2.19 lib/rspec_html/matchers/contain_text.rb
rspec-html-0.2.18 lib/rspec_html/matchers/contain_text.rb
rspec-html-0.2.17 lib/rspec_html/matchers/contain_text.rb
rspec-html-0.2.16 lib/rspec_html/matchers/contain_text.rb
rspec-html-0.2.15 lib/rspec_html/matchers/contain_text.rb
rspec-html-0.2.14 lib/rspec_html/matchers/contain_text.rb
rspec-html-0.2.13 lib/rspec_html/matchers/contain_text.rb
rspec-html-0.2.12 lib/rspec_html/matchers/contain_text.rb
rspec-html-0.2.11 lib/rspec_html/matchers/contain_text.rb
rspec-html-0.2.10 lib/rspec_html/matchers/contain_text.rb
rspec-html-0.2.9 lib/rspec_html/matchers/contain_text.rb
rspec-html-0.2.8 lib/rspec_html/matchers/contain_text.rb