adds to_hash and to_json for collection

This commit is contained in:
Jessica Lynn Suttles 2013-02-04 18:24:21 -08:00
parent 0826659f1e
commit d54e2015a3
6 changed files with 286 additions and 183 deletions

View file

@ -10,15 +10,16 @@ describe Microformats2 do
describe "::parse" do
before do
html = "spec/support/simple.html"
@microformats2 = Microformats2.parse(@html)
end
it "returns an array of found root microformats" do
@microformats2.first.should be_kind_of HCard
it "returns a collection" do
@microformats2.should be_kind_of Microformats2::Collection
end
it "assigns root formats to collection" do
@microformats2.h_card.should be_kind_of HCard
end
it "assigns properties to found root microformats" do
puts @microformats2.first.to_hash
@microformats2.first.name.should == "Jessica Lynn Suttles"
@microformats2.h_card.name.should == "Jessica Lynn Suttles"
end
end