diff --git a/spec/lib/microformats2/collection_spec.rb b/spec/lib/microformats2/collection_spec.rb index e5d3be1..dfca7f3 100644 --- a/spec/lib/microformats2/collection_spec.rb +++ b/spec/lib/microformats2/collection_spec.rb @@ -176,6 +176,20 @@ describe Microformats2::Collection do end end end + + describe "rels.html" do + before do + html = "spec/support/lib/microformats2/rels.html" + @collection = Microformats2.parse(html) + end + describe "#to_json" do + it "should match rels.js" do + json = "spec/support/lib/microformats2/rels.js" + json = open(json).read + JSON.parse(@collection.to_json).should == JSON.parse(json) + end + end + end end diff --git a/spec/support/lib/microformats2/rels.html b/spec/support/lib/microformats2/rels.html new file mode 100644 index 0000000..908e4d4 --- /dev/null +++ b/spec/support/lib/microformats2/rels.html @@ -0,0 +1,12 @@ + + + +Rels Test + + + + +
  • Jeremy Keith
  • +
  • Tantek Çelik
  • + + \ No newline at end of file diff --git a/spec/support/lib/microformats2/rels.js b/spec/support/lib/microformats2/rels.js new file mode 100644 index 0000000..9053dbe --- /dev/null +++ b/spec/support/lib/microformats2/rels.js @@ -0,0 +1,13 @@ +{ + "items": [], + "rels": { + "friend": ["http://adactio.com/", "http://tantek.com/"], + "met": ["http://adactio.com/", "http://tantek.com/"] + }, + "alternates": [ + {"url": "http://tantek.com/updates.atom", + "type": "application/atom+xml", + "rel": "updates" + } + ] +} \ No newline at end of file