class RSpecHTML::Matchers::ContainText

Matches text within a given DOM element.

Public Instance Methods

match(actual) click to toggle source
# File lib/rspec_html/matchers/contain_text.rb, line 11
def match(actual)
  @rspec_actual = actual&.text
  (actual&.text || '').include?(@expected.to_s)
end