yay the world is fixed
This commit is contained in:
parent
40fcdf22d9
commit
b4084d5325
10 changed files with 164 additions and 95 deletions
|
@ -25,21 +25,23 @@ describe Microformats2::Collection do
|
|||
|
||||
describe "#parse" do
|
||||
it "creates ruby class HCard" do
|
||||
@collection.formats.first.should be_kind_of HCard
|
||||
@collection.all.first.should be_kind_of HCard
|
||||
@collection.first.should be_kind_of HCard
|
||||
@collection.card.first.should be_kind_of HCard
|
||||
end
|
||||
it "assigns .h-card .p-name to HCard#name" do
|
||||
@collection.formats.first.name.first.value.should == "Jessica Lynn Suttles"
|
||||
@collection.first.name.first.value.should == "Jessica Lynn Suttles"
|
||||
end
|
||||
it "assigns both .h-card .u-url to HCard#url" do
|
||||
urls = ["http://flickr.com/jlsuttles", "http://twitter.com/jlsuttles"]
|
||||
@collection.formats.first.url.map(&:value).should == urls
|
||||
@collection.first.url.map(&:value).should == urls
|
||||
end
|
||||
it "assings .h-card .dt-bday to HCard#bday" do
|
||||
@collection.formats.first.bday.first.value.should be_kind_of DateTime
|
||||
@collection.formats.first.bday.first.value.to_s.should == "1990-10-15T20:45:33-08:00"
|
||||
@collection.first.bday.first.value.should be_kind_of DateTime
|
||||
@collection.first.bday.first.value.to_s.should == "1990-10-15T20:45:33-08:00"
|
||||
end
|
||||
it "assigns .h-card .e-content to HCard#content" do
|
||||
@collection.formats.first.content.first.value.should == "Vegan. Cat lover. Coder."
|
||||
@collection.first.content.first.value.should == "Vegan. Cat lover. Coder."
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -69,10 +71,12 @@ describe Microformats2::Collection do
|
|||
|
||||
describe "#parse" do
|
||||
it "creates ruby class HEntry" do
|
||||
@collection.formats.first.should be_kind_of HEntry
|
||||
@collection.all.first.should be_kind_of HEntry
|
||||
@collection.first.should be_kind_of HEntry
|
||||
@collection.entry.first.should be_kind_of HEntry
|
||||
end
|
||||
it "assigns .h-entry .p-author to HEntry#author" do
|
||||
@collection.formats.first.author.value.should == "Jessica Lynn Suttles"
|
||||
@collection.first.author.first.value.should == "Jessica Lynn Suttles"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue