Sha256: caaf2b869af9eb8fe153c80846356a7e6dedc237a5e16868d7bb04ed1734cf28

Contents?: true

Size: 308 Bytes

Versions: 9

Compression:

Stored size: 308 Bytes

Contents

require "nokogiri"

RSpec::Matchers.define :have_tag do |tag|
  match do |string|
    document = Nokogiri::HTML(string.to_s)
    !!document.at_css(tag)
  end
end

RSpec::Matchers.define :have_xpath do |tag|
  match do |string|
    document = Nokogiri::HTML(string.to_s)
    !!document.at_xpath(tag)
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
element_factory-0.1.4 spec/support/matchers/elements.rb
table_cloth-0.4.3 spec/support/matchers/element_matchers.rb
table_cloth-0.4.2 spec/support/matchers/element_matchers.rb
table_cloth-0.4.1 spec/support/matchers/element_matchers.rb
element_factory-0.1.3 spec/support/matchers/elements.rb
mixpal-0.0.5 spec/support/matchers/element_matchers.rb
mixpal-0.0.4 spec/support/matchers/element_matchers.rb
table_cloth-0.4.0 spec/support/matchers/element_matchers.rb
element_factory-0.1.2 spec/support/matchers/elements.rb