Sha256: e757bcb353ade91b20a2df39a37b6441a6fc493d1c45ce486b518a39962e3347

Contents?: true

Size: 1.79 KB

Versions: 6

Compression:

Stored size: 1.79 KB

Contents

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

describe Feedjira::Parser::RSSFeedBurner do
  describe "#will_parse?" do
    it "should return true for a feedburner rss feed" do
      Feedjira::Parser::RSSFeedBurner.should be_able_to_parse(sample_rss_feed_burner_feed)
    end

    it "should return false for a regular RSS feed" do
       Feedjira::Parser::RSSFeedBurner.should_not be_able_to_parse(sample_rss_feed)
     end

    it "should return false for a feedburner atom feed" do
      Feedjira::Parser::RSSFeedBurner.should_not be_able_to_parse(sample_feedburner_atom_feed)
    end

    it "should return false for an rdf feed" do
      Feedjira::Parser::RSSFeedBurner.should_not be_able_to_parse(sample_rdf_feed)
    end

    it "should return false for a regular atom feed" do
      Feedjira::Parser::RSSFeedBurner.should_not be_able_to_parse(sample_atom_feed)
    end
  end

  describe "parsing" do
    before(:each) do
      @feed = Feedjira::Parser::RSSFeedBurner.parse(sample_rss_feed_burner_feed)
    end

    it "should parse the title" do
      @feed.title.should == "TechCrunch"
    end

    it "should parse the description" do
      @feed.description.should == "TechCrunch is a group-edited blog that profiles the companies, products and events defining and transforming the new web."
    end

    it "should parse the url" do
      @feed.url.should == "http://techcrunch.com"
    end

    it "should parse the hub urls" do
      @feed.hubs.count.should == 2
      @feed.hubs.first.should == "http://pubsubhubbub.appspot.com/"
    end

    it "should provide an accessor for the feed_url" do
      @feed.respond_to?(:feed_url).should == true
      @feed.respond_to?(:feed_url=).should == true
    end

    it "should parse entries" do
      @feed.entries.size.should == 20
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
feedjira-1.3.1 spec/feedjira/parser/rss_feed_burner_spec.rb
feedjira-1.3.0 spec/feedjira/parser/rss_feed_burner_spec.rb
feedjira-1.2.0 spec/feedjira/parser/rss_feed_burner_spec.rb
feedjira-1.1.0 spec/feedjira/parser/rss_feed_burner_spec.rb
feedjira-1.0.0 spec/feedjira/parser/rss_feed_burner_spec.rb
feedjira-0.9.0 spec/feedjira/parser/rss_feed_burner_spec.rb