Sha256: a28d29bca10e21a663dbf6d29ab73ce0093eb711fce489df45da94c4a3e012ef

Contents?: true

Size: 1.64 KB

Versions: 56

Compression:

Stored size: 1.64 KB

Contents

require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])

describe Feedzirra::Parser::RSSEntry do
  before(:each) do
    # I don't really like doing it this way because these unit test should only rely on RSSEntry,
    # but this is actually how it should work. You would never just pass entry xml straight to the AtomEnry
    @entry = Feedzirra::Parser::RSS.parse(sample_rss_feed).entries.first
  end
  
  it "should parse the title" do
    @entry.title.should == "Nokogiri’s Slop Feature"
  end
  
  it "should parse the url" do
    @entry.url.should == "http://tenderlovemaking.com/2008/12/04/nokogiris-slop-feature/"
  end
  
  it "should parse the author" do
    @entry.author.should == "Aaron Patterson"
  end
  
  it "should parse the content" do
    @entry.content.should == sample_rss_entry_content
  end
  
  it "should provide a summary" do
    @entry.summary.should == "Oops!  When I released nokogiri version 1.0.7, I totally forgot to talk about Nokogiri::Slop() feature that was added.  Why is it called \"slop\"?  It lets you sloppily explore documents.  Basically, it decorates your document with method_missing() that allows you to search your document via method calls.\nGiven this document:\n\ndoc = Nokogiri::Slop(<<-eohtml)\n<html>\n  <body>\n  [...]"
  end
  
  it "should parse the published date" do
    @entry.published.to_s.should == "Thu Dec 04 17:17:49 UTC 2008"
  end

  it "should parse the categories" do
    @entry.categories.should == ['computadora', 'nokogiri', 'rails']
  end
  
  it "should parse the guid as id" do
    @entry.id.should == "http://tenderlovemaking.com/?p=198"
  end
end

Version data entries

56 entries across 56 versions & 21 rubygems

Version Path
UnderpantsGnome-feedzirra-0.0.14 spec/feedzirra/parser/rss_entry_spec.rb
UnderpantsGnome-feedzirra-0.0.15 spec/feedzirra/parser/rss_entry_spec.rb
astro-feedzirra-0.0.12 spec/feedzirra/parser/rss_entry_spec.rb
dakrone-feedzirra-0.0.16.1 spec/feedzirra/parser/rss_entry_spec.rb
jsl-feedzirra-0.0.12.1 spec/feedzirra/parser/rss_entry_spec.rb
jsl-feedzirra-0.0.12.10 spec/feedzirra/parser/rss_entry_spec.rb
jsl-feedzirra-0.0.12.12 spec/feedzirra/parser/rss_entry_spec.rb
jsl-feedzirra-0.0.12.2 spec/feedzirra/parser/rss_entry_spec.rb
jsl-feedzirra-0.0.12.3 spec/feedzirra/parser/rss_entry_spec.rb
jsl-feedzirra-0.0.12.4 spec/feedzirra/parser/rss_entry_spec.rb
jsl-feedzirra-0.0.12.5 spec/feedzirra/parser/rss_entry_spec.rb
jsl-feedzirra-0.0.12.6 spec/feedzirra/parser/rss_entry_spec.rb
jsl-feedzirra-0.0.12.7 spec/feedzirra/parser/rss_entry_spec.rb
jsl-feedzirra-0.0.12.8 spec/feedzirra/parser/rss_entry_spec.rb
jsl-feedzirra-0.0.12.9 spec/feedzirra/parser/rss_entry_spec.rb
julien51-feedzirra-0.0.13 spec/feedzirra/parser/rss_entry_spec.rb
logophobia-feedzirra-0.0.15 spec/feedzirra/parser/rss_entry_spec.rb
maxlapshin-feedzirra-0.0.16.1 spec/feedzirra/parser/rss_entry_spec.rb
maxlapshin-feedzirra-0.0.16.2 spec/feedzirra/parser/rss_entry_spec.rb
maxlapshin-feedzirra-0.0.16.3 spec/feedzirra/parser/rss_entry_spec.rb