Sha256: b28c84fb9b38febbb62ef0efac311daf36fe6a433dde0768c403e9bc1b885077
Contents?: true
Size: 666 Bytes
Versions: 11
Compression:
Stored size: 666 Bytes
Contents
require File.join(File.dirname(__FILE__),'../../spec_helper') describe IMW::Formats::Xml do # just spec Xml now as the others are identical before do @sample = IMW.open(File.join(IMWTest::DATA_DIR, 'formats/sgml/sample.xml')) end it "should be able to load the XML" do ((@sample.load/"genus").first/"name").first.inner_text.should == 'Mandrillus' end it "should yield the XML when load is given a block" do @sample.load do |xml| ((xml/"genus").first/"name").first.inner_text.should == 'Mandrillus' end end it "should parse the XML" do @sample.parse(:species => ['species[@id]'])[:species].size.should == 130 end end
Version data entries
11 entries across 11 versions & 1 rubygems