Sha256: 704bf5a2e9f5c441a9749cf1575a3a69999a981580fa91025eb8295fe93f6354
Contents?: true
Size: 483 Bytes
Versions: 1
Compression:
Stored size: 483 Bytes
Contents
require 'spec_helper' describe VTD::Xml::Parser do let(:parser) { VTD::Xml::Parser.new 'spec/fixtures/books.xml' } let(:book) { parser.find('//book[1]').first } it 'will pull everything that matches your XPath' do expect(parser.find('//book/author').to_a.length).to eq(3) end it 'yields a node for each match' do parser.find('//book/author').with_index do |node, index| expect(node.name).to eq('author') expect(node.text).to be_nil end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vtd-xml-0.0.3-java | spec/vtd/xml/parser_spec.rb |