module RSpecHTML::Matchers
Provides matchers for identifying elements and text within a DOM element.
Public Class Methods
define_matcher(name, class_)
click to toggle source
rubocop:disable Metrics/MethodLength
# File lib/rspec_html/matchers.rb, line 14 def self.define_matcher(name, class_) matcher name do |expected, options| rspec_html_matcher = class_.new(expected, options || {}) match do |actual| rspec_html_matcher .save_actual(actual) .match(actual) .tap { @actual = rspec_html_matcher.rspec_actual } end description { rspec_html_matcher.description } failure_message { rspec_html_matcher.failure_message } diffable if class_.diffable? end end