require 'spec/spec_helper' module ArraySpec class Book include ROXML xml_reader :id, :as => Integer xml_reader :title end class Store include ROXML xml_reader :books, :from => 'books', :as => [Book] end class MyXml include ROXML xml_reader :store, :as => Store end end describe ":as => []" do context "with plural from" do it "should accept the plural name as the name for each item" do ArraySpec::MyXml.from_xml(%( 1first book 2second book 3third book )).store.books.size.should == 3 end end end