Sha256: ee411f7523f76d092c177c889ba0dada3d9cb89d8ac2c6b96e328c6c23451cee

Contents?: true

Size: 309 Bytes

Versions: 8

Compression:

Stored size: 309 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

8 entries across 8 versions & 1 rubygems

Version Path
mixpal-0.5.0 spec/support/matchers/element_matchers.rb
mixpal-0.4.2 spec/support/matchers/element_matchers.rb
mixpal-0.4.1 spec/support/matchers/element_matchers.rb
mixpal-0.4.0 spec/support/matchers/element_matchers.rb
mixpal-0.3.0 spec/support/matchers/element_matchers.rb
mixpal-0.2.1 spec/support/matchers/element_matchers.rb
mixpal-0.2.0 spec/support/matchers/element_matchers.rb
mixpal-0.1.0 spec/support/matchers/element_matchers.rb