Sha256: 89a27495cc1a7c37c7e43da33c727e8e55c1e9134abb7b6a078bbe7d3978fe40
Contents?: true
Size: 1.42 KB
Versions: 10
Compression:
Stored size: 1.42 KB
Contents
require 'spec_helper' include Rosemary describe Parser do context "xml" do it "parses ampersands correctly" do node_xml =<<-EOF <osm> <node id="123" lat="51.2" lon="13.4" version="42" changeset="12" user="fred" uid="123" visible="true" timestamp="2005-07-30T14:27:12+01:00"> <tag k="note" v="Just a node"/> <tag k="amenity" v="bar" /> <tag k="name" v="The rose & the pony" /> </node> </osm> EOF n = Parser.call(node_xml, :xml) n.name.should == "The rose & the pony" end it "parses empty set of permissions" do permissions_xml =<<-EOF <osm version="0.6" generator="OpenStreetMap Server"> <permissions> </permissions> </osm> EOF permissions = Parser.call(permissions_xml, :xml) permissions.raw.should be_empty end it "parses permissions" do permissions_xml =<<-EOF <osm version="0.6" generator="OpenStreetMap Server"> <permissions> <permission name="allow_read_prefs" /> <permission name="allow_write_api" /> </permissions> </osm> EOF permissions = Parser.call(permissions_xml, :xml) permissions.raw.sort.should == %w(allow_read_prefs allow_write_api) permissions.allow_write_api?.should be_true permissions.allow_read_prefs?.should be_true permissions.allow_write_prefs?.should be_false end end end
Version data entries
10 entries across 10 versions & 1 rubygems