module RSpec::HtmlMatchers
def with_text text
def with_text text raise StandardError, 'this matcher should be used inside "have_tag" matcher block' unless defined?(@__current_scope_for_nokogiri_matcher) raise ArgumentError, 'this matcher does not accept block' if block_given? tag = @__current_scope_for_nokogiri_matcher.instance_variable_get(:@tag) expect(@__current_scope_for_nokogiri_matcher).to have_tag(tag, :text => text) end