Sha256: 01e1ba0b792ccd1dc149b382ecdaf5acf80599edcf52eb776e0a564b65bcefdb

Contents?: true

Size: 1.89 KB

Versions: 3

Compression:

Stored size: 1.89 KB

Contents

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

describe Feedjira::Parser::ITunesRSS do
  describe "#will_parse?" do
    it "should return true for an itunes RSS feed" do
      Feedjira::Parser::ITunesRSS.should be_able_to_parse(sample_itunes_feed)
    end

    it "should return true for an itunes RSS feed with spaces between attribute names, equals sign, and values" do
      Feedjira::Parser::ITunesRSS.should be_able_to_parse(sample_itunes_feed_with_spaces)
    end

    it "should return fase for an atom feed" do
      Feedjira::Parser::ITunesRSS.should_not be_able_to_parse(sample_atom_feed)
    end

    it "should return false for an rss feedburner feed" do
      Feedjira::Parser::ITunesRSS.should_not be_able_to_parse(sample_rss_feed_burner_feed)
    end
  end

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

    it "should parse the subtitle" do
      @feed.itunes_subtitle.should == "A show about everything"
    end

    it "should parse the author" do
      @feed.itunes_author.should == "John Doe"
    end

    it "should parse an owner" do
      @feed.itunes_owners.size.should == 1
    end

    it "should parse an image" do
      @feed.itunes_image.should == "http://example.com/podcasts/everything/AllAboutEverything.jpg"
    end

    it "should parse categories" do
      @feed.itunes_categories.size == 3
      @feed.itunes_categories[0] == "Technology"
      @feed.itunes_categories[1] == "Gadgets"
      @feed.itunes_categories[2] == "TV & Film"
    end

    it "should parse the summary" do
      @feed.itunes_summary.should == "All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our Podcast in the iTunes Music Store"
    end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
feedjira-1.1.0 spec/feedjira/parser/itunes_rss_spec.rb
feedjira-1.0.0 spec/feedjira/parser/itunes_rss_spec.rb
feedjira-0.9.0 spec/feedjira/parser/itunes_rss_spec.rb