Sha256: 810866c153ff82a2760f99974b8cfe1ed21425ffd2021de4343bcc9c6bd1f769

Contents?: true

Size: 331 Bytes

Versions: 1

Compression:

Stored size: 331 Bytes

Contents

RSpec::Matchers.define :match_xpath do |xpath, expected_value|
  match do |xml|
    @xml = Nokogiri::XML xml
    @xml.remove_namespaces!
    @xml.xpath(xpath).text.should == expected_value.to_s
  end

  failure_message_for_should do |actual|
    "expected xpath '#{xpath}' with value '#{expected_value}' in doc:\n#{@xml}"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
afipws-1.0.0 spec/support/matchers.rb