Sha256: 4fe9379930a7146643f4bb656f2be22b630f8c4e03e20fbb2956a1de33bedba6
Contents?: true
Size: 486 Bytes
Versions: 12
Compression:
Stored size: 486 Bytes
Contents
require 'nokogiri' module NokogiriMatchers class HtmlMatchers def initialize(tag) @tag = tag.to_s end def matches?(document) @document = Nokogiri::HTML.fragment document !@document.search(@tag).nil? end def failure_message_for_should "expected to find #{@tag} within #{@document.to_s} but was not found" end end def have_tag(expect) HtmlMatchers.new(expect) end end RSpec.configure do |c| c.include NokogiriMatchers end
Version data entries
12 entries across 12 versions & 1 rubygems