Sha256: d37f5ae3e29024da252edbd0fba35716b7b3af278128767df845ed08a3e549f0
Contents?: true
Size: 979 Bytes
Versions: 4
Compression:
Stored size: 979 Bytes
Contents
require 'spec_helper' require_relative './../../examples/person' describe Person do before do @person = Person.new @person.name = 'John Doe' @person.lat = '40.715224' @person.long = '-74.005966' @person.street = 'Evergreen Terrace' @person.city = 'Springfield' @person.zip = '2342' end it 'should only contain one location element' do expect(ROXML::XML.search(@person.to_xml, 'location').count).to eq(1) end describe '#to_xml' do before do @xml_generated = @person.to_xml.to_s.gsub("\n",'').squeeze(' ') end it 'should generate the expected xml' do xml_file = File.read(xml_for('person')).gsub("\n",'').squeeze(' ') expect(xml_file).to eq(@xml_generated) end it 'should generate identical xml after a full roundtrip' do p = Person.from_xml(@xml_generated) xml_roundtrip = p.to_xml.to_s.gsub("\n",'').squeeze(' ') expect(xml_roundtrip).to eq(@xml_generated) end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
roxml-4.2.0 | spec/examples/person_spec.rb |
roxml-4.1.1 | spec/examples/person_spec.rb |
roxml-4.1.0 | spec/examples/person_spec.rb |
roxml-4.0.0 | spec/examples/person_spec.rb |