Sha256: 32eebffbe4e48a692065a51e9130a3ada6f6f147ac057d0b8fca80f57c616c40

Contents?: true

Size: 1.4 KB

Versions: 9

Compression:

Stored size: 1.4 KB

Contents

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

describe Feedzirra::Parser::RSS do
  describe "#will_parse?" do
    it "should return true for an RSS feed" do
      Feedzirra::Parser::RSS.should be_able_to_parse(sample_rss_feed)
    end

    # this is no longer true. combined rdf and rss into one
    # it "should return false for an rdf feed" do
    #   Feedzirra::RSS.should_not be_able_to_parse(sample_rdf_feed)
    # end
    
    it "should return false for an atom feed" do
      Feedzirra::Parser::RSS.should_not be_able_to_parse(sample_atom_feed)
    end
    
    it "should return false for an rss feedburner feed" do
      Feedzirra::Parser::RSS.should_not be_able_to_parse(sample_rss_feed_burner_feed)
    end
  end

  describe "parsing" do
    before(:each) do
      @feed = Feedzirra::Parser::RSS.parse(sample_rss_feed)
    end
    
    it "should parse the title" do
      @feed.title.should == "Tender Lovemaking"
    end

    it "should parse the description" do
      @feed.description.should == "The act of making love, tenderly."
    end

    it "should parse the url" do
      @feed.url.should == "http://tenderlovemaking.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 == 10
    end
  end
end

Version data entries

9 entries across 9 versions & 4 rubygems

Version Path
feedzirra-0.2.1 spec/feedzirra/parser/rss_spec.rb
codders-feedzirra-0.2.0.rc2 spec/feedzirra/parser/rss_spec.rb
feedzirra-0.2.0.rc2 spec/feedzirra/parser/rss_spec.rb
feedzirra-0.2.0.rc1 spec/feedzirra/parser/rss_spec.rb
jashmenn-feedzirra-0.1.3 spec/feedzirra/parser/rss_spec.rb
feedzirra-0.1.3 spec/feedzirra/parser/rss_spec.rb
feedzirra-0.1.2 spec/feedzirra/parser/rss_spec.rb
seanwalbran-feedzirra-0.1.3 spec/feedzirra/parser/rss_spec.rb
seanwalbran-feedzirra-0.1.2 spec/feedzirra/parser/rss_spec.rb