Sha256: 6c820c51456b217dec5ab4c043e6799973aa6b7fdcff48a01a529f44672fb293
Contents?: true
Size: 769 Bytes
Versions: 36
Compression:
Stored size: 769 Bytes
Contents
require 'rubygems' require 'rubyXL' describe RubyXL::Hash do before do @xml = '<root xmlns:foo="bar"><bar hello="world"/></root>' @hash = { :root => { :bar => { :attributes => { :hello => 'world' } } } } end describe '.from_xml' do it 'should create a hash which correctly corresponds to XML' do nokogiri = RubyXL::Hash.from_xml(@xml) nokogiri.should == @hash end end describe '.xml_node_to_hash' do it 'should create a hash which correctly corresponds to a Nokogiri root node' do nokogiri = Nokogiri::XML::Document.parse(@xml) my_hash = RubyXL::Hash.xml_node_to_hash(nokogiri.root) my_hash.should == @hash[:root] end end end
Version data entries
36 entries across 36 versions & 3 rubygems