Sha256: f3873ed1080ff327639a5cb64555ebb14323082263f9bf9bf77e92554df4eedc

Contents?: true

Size: 499 Bytes

Versions: 3

Compression:

Stored size: 499 Bytes

Contents

require File.dirname(__FILE__) + "/../spec_helper"

describe "Hash" do 
  it "should parse xml to hash" do
    Hash.public_methods.include?("from_xml").should be_true
  end

  it "should parse xml" do
    xml_string = open(File.dirname(__FILE__) + "/../files/meta.xml").read
    meta = Hash.from_xml(xml_string)
    meta[:archive].keys.map {|k| k.to_s}.sort.should == %w(core extension)
    meta[:archive][:core].keys.map{|k| k.to_s}.sort.should == ["attributes", "field", "files", "id"]
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dwc-archive-0.1.4 spec/lib/ruby_extenstions_spec.rb
dwc-archive-0.1.3 spec/lib/ruby_extenstions_spec.rb
dwc-archive-0.1.2 spec/lib/ruby_extenstions_spec.rb