Sha256: a0a2b3b160e2e2e568f61bcee87ef3134b484673ed5b7425e23ec8492ed030c5

Contents?: true

Size: 1.27 KB

Versions: 3

Compression:

Stored size: 1.27 KB

Contents

require 'microby'

describe Microby::HEntry do
  let(:result) { Microby.parse(File.open("spec/support/example.html")) }
  let(:entry) { result.entries.first }

  it "should have an array of entries" do
    entry.should be_an_instance_of Microby::HEntry
  end

  it "has a name" do
    entry.name.should eq "Senior Cat Living"
  end

  it "has a summary" do
    entry.summary.should eq "Signed up with 3 locations"
  end

  it "has a time" do
    entry.published_at.should eq "2012-08-26 20:09-0700"
  end

  it "has a bookmark" do
    entry.bookmark.should eq "http://g5.com/feed/entries/2012-08-26-20-09-0700"
  end

  it "has an author as an hcard" do
    entry.author.should be_an_instance_of Microby::HCard
  end

  describe "categories" do
    it "has an array of categories" do
      entry.categories.should be_an_instance_of Hash
    end

    it "has a key of the content" do
      entry.categories["New Customer"].should eq "http://g5.com/tag/new-customer"
    end
  end

  describe "content" do
    let(:content) { entry.content }

    it "should be a blob of html" do
      content.should match /Locations/
    end

    it "should be a blob of html" do
      content.should match /\<dt\>/
    end

    it "should be a blob of html" do
      content.should_not match /time/
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
microby-0.0.3 spec/lib/microby/h_entry_spec.rb
microby-0.0.2 spec/lib/microby/h_entry_spec.rb
microby-0.0.1 spec/lib/microby/h_entry_spec.rb