Sha256: 8bf97197b3108b57bc787574fcaa5650f846511b93ad290f1bf64715b7e3f265
Contents?: true
Size: 977 Bytes
Versions: 1
Compression:
Stored size: 977 Bytes
Contents
require 'hentry_consumer' describe HentryConsumer::HFeed do let(:feed) { HentryConsumer.parse(File.open("spec/support/example.html")) } describe "to json" do let(:json) { feed.to_json } it { json[:items].first[:type].should include 'h-feed'} it { json[:items].first[:properties][:entries].should be_an_instance_of Array } it { json[:items].first[:properties][:entries].first[:items].should be_an_instance_of Array } it { json[:items].first[:properties][:entries].first[:items].first[:type].should include "h-entry" } end # <article class=\"h-entry\"><h1 class=\"p-name\">Senior Cat Living</h1> # <article class=\"h-entry\">\n <h1 class=\"p-name\">Senior Cat Living</h1>\n describe "html" do describe "html" do let(:html) { feed.to_html } it "should match the example html" do html.gsub(/\\n|\s/, '').should eq File.open("spec/support/example.html").read.gsub(/\\n|\s/, '') end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
hentry_consumer-0.3.1 | spec/lib/hentry_consumer/h_feed_spec.rb |