Sha256: 00ebe3fac593ce5c26e8e3d01dc3c0733c4cfc465b0b4703ecd547e9a2b34d1b
Contents?: true
Size: 987 Bytes
Versions: 3
Compression:
Stored size: 987 Bytes
Contents
require 'spec/spec_helper.rb' describe ROXML, "#xml_namespaces" do class Tires include ROXML xml_namespaces \ :bobsbike => 'http://bobsbikes.example.com', :alicesauto => 'http://alicesautosupply.example.com/' xml_reader :bike_tires, :as => [], :from => '@name', :in => 'bobsbike:tire' xml_reader :car_tires, :as => [], :from => '@name', :in => 'alicesauto:tire' end before do @xml = %{<?xml version="1.0"?> <inventory xmlns="http://alicesautosupply.example.com/" xmlns:bike="http://bobsbikes.example.com"> <tire name="super slick racing tire" /> <tire name="all weather tire" /> <bike:tire name="skinny street" /> </inventory> } end it "should remap default namespaces" do Tires.from_xml(@xml).car_tires.should =~ ['super slick racing tire', 'all weather tire'] end it "should remap prefix namespaces" do Tires.from_xml(@xml).bike_tires.should == ['skinny street'] end end
Version data entries
3 entries across 3 versions & 2 rubygems
Version | Path |
---|---|
roxml-3.1.1 | spec/xml/namespaces_spec.rb |
roxml-3.1.0 | spec/xml/namespaces_spec.rb |
ROXML-3.0.0 | spec/xml/namespaces_spec.rb |