feedjira 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +8 -0
  4. data/.travis.yml +31 -12
  5. data/CHANGELOG.md +15 -1
  6. data/Dangerfile +1 -0
  7. data/Gemfile +2 -1
  8. data/Rakefile +6 -1
  9. data/feedjira.gemspec +16 -14
  10. data/fixtures/vcr_cassettes/fetch_failure.yml +62 -0
  11. data/fixtures/vcr_cassettes/parse_error.yml +222 -0
  12. data/fixtures/vcr_cassettes/success.yml +281 -0
  13. data/lib/feedjira.rb +9 -0
  14. data/lib/feedjira/core_ext.rb +3 -3
  15. data/lib/feedjira/core_ext/date.rb +2 -1
  16. data/lib/feedjira/core_ext/string.rb +1 -1
  17. data/lib/feedjira/core_ext/time.rb +19 -16
  18. data/lib/feedjira/date_time_utilities.rb +24 -0
  19. data/lib/feedjira/date_time_utilities/date_time_language_parser.rb +22 -0
  20. data/lib/feedjira/date_time_utilities/date_time_pattern_parser.rb +29 -0
  21. data/lib/feedjira/feed.rb +27 -18
  22. data/lib/feedjira/feed_entry_utilities.rb +15 -17
  23. data/lib/feedjira/feed_utilities.rb +26 -21
  24. data/lib/feedjira/parser/atom.rb +9 -8
  25. data/lib/feedjira/parser/atom_entry.rb +10 -13
  26. data/lib/feedjira/parser/atom_feed_burner.rb +8 -10
  27. data/lib/feedjira/parser/atom_feed_burner_entry.rb +11 -14
  28. data/lib/feedjira/parser/atom_youtube.rb +20 -0
  29. data/lib/feedjira/parser/atom_youtube_entry.rb +29 -0
  30. data/lib/feedjira/parser/google_docs_atom.rb +6 -6
  31. data/lib/feedjira/parser/google_docs_atom_entry.rb +11 -11
  32. data/lib/feedjira/parser/itunes_rss.rb +39 -22
  33. data/lib/feedjira/parser/itunes_rss_category.rb +38 -0
  34. data/lib/feedjira/parser/itunes_rss_item.rb +28 -20
  35. data/lib/feedjira/parser/itunes_rss_owner.rb +3 -4
  36. data/lib/feedjira/parser/podlove_chapter.rb +20 -0
  37. data/lib/feedjira/parser/rss.rb +10 -8
  38. data/lib/feedjira/parser/rss_entry.rb +17 -21
  39. data/lib/feedjira/parser/rss_feed_burner.rb +4 -6
  40. data/lib/feedjira/parser/rss_feed_burner_entry.rb +23 -28
  41. data/lib/feedjira/parser/rss_image.rb +15 -0
  42. data/lib/feedjira/preprocessor.rb +2 -2
  43. data/lib/feedjira/version.rb +1 -1
  44. data/spec/feedjira/date_time_utilities_spec.rb +41 -0
  45. data/spec/feedjira/feed_entry_utilities_spec.rb +23 -19
  46. data/spec/feedjira/feed_spec.rb +109 -74
  47. data/spec/feedjira/feed_utilities_spec.rb +65 -63
  48. data/spec/feedjira/parser/atom_entry_spec.rb +54 -34
  49. data/spec/feedjira/parser/atom_feed_burner_entry_spec.rb +27 -20
  50. data/spec/feedjira/parser/atom_feed_burner_spec.rb +32 -30
  51. data/spec/feedjira/parser/atom_spec.rb +50 -48
  52. data/spec/feedjira/parser/atom_youtube_entry_spec.rb +86 -0
  53. data/spec/feedjira/parser/atom_youtube_spec.rb +43 -0
  54. data/spec/feedjira/parser/google_docs_atom_entry_spec.rb +5 -4
  55. data/spec/feedjira/parser/google_docs_atom_spec.rb +6 -6
  56. data/spec/feedjira/parser/itunes_rss_item_spec.rb +33 -29
  57. data/spec/feedjira/parser/itunes_rss_owner_spec.rb +10 -9
  58. data/spec/feedjira/parser/itunes_rss_spec.rb +83 -30
  59. data/spec/feedjira/parser/podlove_chapter_spec.rb +37 -0
  60. data/spec/feedjira/parser/rss_entry_spec.rb +50 -33
  61. data/spec/feedjira/parser/rss_feed_burner_entry_spec.rb +55 -33
  62. data/spec/feedjira/parser/rss_feed_burner_spec.rb +31 -26
  63. data/spec/feedjira/parser/rss_spec.rb +56 -24
  64. data/spec/feedjira/preprocessor_spec.rb +11 -3
  65. data/spec/sample_feeds.rb +29 -21
  66. data/spec/sample_feeds/AmazonWebServicesBlog.xml +797 -797
  67. data/spec/sample_feeds/AtomEscapedHTMLInPreTag.xml +13 -0
  68. data/spec/sample_feeds/CRE.xml +5849 -0
  69. data/spec/sample_feeds/FeedBurnerXHTML.xml +400 -400
  70. data/spec/sample_feeds/ITunesWithSingleQuotedAttributes.xml +67 -0
  71. data/spec/sample_feeds/PaulDixExplainsNothing.xml +175 -175
  72. data/spec/sample_feeds/PaulDixExplainsNothingAlternate.xml +175 -175
  73. data/spec/sample_feeds/PaulDixExplainsNothingFirstEntryContent.xml +16 -16
  74. data/spec/sample_feeds/PaulDixExplainsNothingWFW.xml +174 -174
  75. data/spec/sample_feeds/TenderLovemaking.xml +12 -2
  76. data/spec/sample_feeds/TrotterCashionHome.xml +611 -611
  77. data/spec/sample_feeds/TypePadNews.xml +368 -368
  78. data/spec/sample_feeds/itunes.xml +18 -2
  79. data/spec/sample_feeds/pet_atom.xml +229 -229
  80. data/spec/sample_feeds/youtube_atom.xml +395 -0
  81. data/spec/spec_helper.rb +6 -0
  82. metadata +112 -27
@@ -0,0 +1,86 @@
1
+ require File.join(File.dirname(__FILE__), %w(.. .. spec_helper))
2
+
3
+ describe Feedjira::Parser::AtomYoutubeEntry do
4
+ describe 'parsing' do
5
+ before do
6
+ @feed = Feedjira::Parser::AtomYoutube.parse(sample_youtube_atom_feed)
7
+ @entry = @feed.entries.first
8
+ end
9
+
10
+ it 'should have the title' do
11
+ expect(@entry.title).to eq 'The Google app: Questions Title'
12
+ end
13
+
14
+ it 'should have the url' do
15
+ expect(@entry.url).to eq 'http://www.youtube.com/watch?v=5shykyfmb28'
16
+ end
17
+
18
+ it 'should have the entry id' do
19
+ expect(@entry.entry_id).to eq 'yt:video:5shykyfmb28'
20
+ end
21
+
22
+ it 'should have the published date' do
23
+ expect(@entry.published).to eq Time.parse_safely('2015-05-04T00:01:27+00:00') # rubocop:disable Metrics/LineLength
24
+ end
25
+
26
+ it 'should have the updated date' do
27
+ expect(@entry.updated).to eq Time.parse_safely('2015-05-13T17:38:30+00:00') # rubocop:disable Metrics/LineLength
28
+ end
29
+
30
+ it 'should have the content populated from the media:description element' do
31
+ expect(@entry.content).to eq 'A question is the most powerful force in the world. It can start you on an adventure or spark a connection. See where a question can take you. The Google app is available on iOS and Android. Download the app here: http://www.google.com/search/about/download' # rubocop:disable Metrics/LineLength
32
+ end
33
+
34
+ it 'should have the summary but blank' do
35
+ expect(@entry.summary).to be_nil
36
+ end
37
+
38
+ it 'should have the custom youtube video id' do
39
+ expect(@entry.youtube_video_id).to eq '5shykyfmb28'
40
+ end
41
+
42
+ it 'should have the custom media title' do
43
+ expect(@entry.media_title).to eq 'The Google app: Questions'
44
+ end
45
+
46
+ it 'should have the custom media url' do
47
+ expect(@entry.media_url).to eq 'https://www.youtube.com/v/5shykyfmb28?version=3' # rubocop:disable Metrics/LineLength
48
+ end
49
+
50
+ it 'should have the custom media type' do
51
+ expect(@entry.media_type).to eq 'application/x-shockwave-flash'
52
+ end
53
+
54
+ it 'should have the custom media width' do
55
+ expect(@entry.media_width).to eq '640'
56
+ end
57
+
58
+ it 'should have the custom media height' do
59
+ expect(@entry.media_height).to eq '390'
60
+ end
61
+
62
+ it 'should have the custom media thumbnail url' do
63
+ expect(@entry.media_thumbnail_url).to eq 'https://i2.ytimg.com/vi/5shykyfmb28/hqdefault.jpg' # rubocop:disable Metrics/LineLength
64
+ end
65
+
66
+ it 'should have the custom media thumbnail width' do
67
+ expect(@entry.media_thumbnail_width).to eq '480'
68
+ end
69
+
70
+ it 'should have the custom media thumbnail height' do
71
+ expect(@entry.media_thumbnail_height).to eq '360'
72
+ end
73
+
74
+ it 'should have the custom media star count' do
75
+ expect(@entry.media_star_count).to eq '3546'
76
+ end
77
+
78
+ it 'should have the custom media star average' do
79
+ expect(@entry.media_star_average).to eq '4.79'
80
+ end
81
+
82
+ it 'should have the custom media views' do
83
+ expect(@entry.media_views).to eq '251497'
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,43 @@
1
+ require File.join(File.dirname(__FILE__), %w(.. .. spec_helper))
2
+
3
+ describe Feedjira::Parser::AtomYoutube do
4
+ describe '#will_parse?' do
5
+ it 'should return true for an atom youtube feed' do
6
+ expect(Feedjira::Parser::AtomYoutube).to be_able_to_parse(sample_youtube_atom_feed) # rubocop:disable Metrics/LineLength
7
+ end
8
+
9
+ it 'should return fase for an atom feed' do
10
+ expect(Feedjira::Parser::AtomYoutube).to_not be_able_to_parse(sample_atom_feed) # rubocop:disable Metrics/LineLength
11
+ end
12
+
13
+ it 'should return false for an rss feedburner feed' do
14
+ expect(Feedjira::Parser::AtomYoutube).to_not be_able_to_parse(sample_rss_feed_burner_feed) # rubocop:disable Metrics/LineLength
15
+ end
16
+ end
17
+
18
+ describe 'parsing' do
19
+ before(:each) do
20
+ @feed = Feedjira::Parser::AtomYoutube.parse(sample_youtube_atom_feed)
21
+ end
22
+
23
+ it 'should parse the title' do
24
+ expect(@feed.title).to eq 'Google'
25
+ end
26
+
27
+ it 'should parse the author' do
28
+ expect(@feed.author).to eq 'Google Author'
29
+ end
30
+
31
+ it 'should parse the url' do
32
+ expect(@feed.url).to eq 'http://www.youtube.com/user/Google'
33
+ end
34
+
35
+ it 'should parse the feed_url' do
36
+ expect(@feed.feed_url).to eq 'http://www.youtube.com/feeds/videos.xml?user=google'
37
+ end
38
+
39
+ it 'should parse the YouTube channel id' do
40
+ expect(@feed.youtube_channel_id).to eq 'UCK8sQmJBp8GCxrOtXWBpyEA'
41
+ end
42
+ end
43
+ end
@@ -1,9 +1,10 @@
1
- require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
1
+ require 'spec_helper'
2
2
 
3
3
  describe Feedjira::Parser::GoogleDocsAtomEntry do
4
4
  describe 'parsing' do
5
5
  before do
6
- @feed = Feedjira::Parser::GoogleDocsAtom.parse(sample_google_docs_list_feed)
6
+ xml = sample_google_docs_list_feed
7
+ @feed = Feedjira::Parser::GoogleDocsAtom.parse xml
7
8
  @entry = @feed.entries.first
8
9
  end
9
10
 
@@ -12,11 +13,11 @@ describe Feedjira::Parser::GoogleDocsAtomEntry do
12
13
  end
13
14
 
14
15
  it 'should have the custom filename element' do
15
- expect(@entry.original_filename).to eq "MyFile.pdf"
16
+ expect(@entry.original_filename).to eq 'MyFile.pdf'
16
17
  end
17
18
 
18
19
  it 'should have the custom suggested filename element' do
19
- expect(@entry.suggested_filename).to eq "TaxDocument.pdf"
20
+ expect(@entry.suggested_filename).to eq 'TaxDocument.pdf'
20
21
  end
21
22
  end
22
23
  end
@@ -1,19 +1,19 @@
1
- require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
1
+ require 'spec_helper'
2
2
 
3
- describe Feedjira::Parser::GoogleDocsAtom do
3
+ module Feedjira::Parser
4
4
  describe '.able_to_parser?' do
5
5
  it 'should return true for Google Docs feed' do
6
- expect(Feedjira::Parser::GoogleDocsAtom).to be_able_to_parse(sample_google_docs_list_feed)
6
+ expect(GoogleDocsAtom).to be_able_to_parse(sample_google_docs_list_feed)
7
7
  end
8
8
 
9
9
  it 'should not be able to parse another Atom feed' do
10
- expect(Feedjira::Parser::GoogleDocsAtom).to_not be_able_to_parse(sample_atom_feed)
10
+ expect(GoogleDocsAtom).to_not be_able_to_parse(sample_atom_feed)
11
11
  end
12
12
  end
13
13
 
14
14
  describe 'parsing' do
15
15
  before do
16
- @feed = Feedjira::Parser::GoogleDocsAtom.parse(sample_google_docs_list_feed)
16
+ @feed = GoogleDocsAtom.parse(sample_google_docs_list_feed)
17
17
  end
18
18
 
19
19
  it 'should return a bunch of objects' do
@@ -25,7 +25,7 @@ describe Feedjira::Parser::GoogleDocsAtom do
25
25
  end
26
26
 
27
27
  it 'should return a bunch of entries of type GoogleDocsAtomEntry' do
28
- expect(@feed.entries.first).to be_a Feedjira::Parser::GoogleDocsAtomEntry
28
+ expect(@feed.entries.first).to be_a GoogleDocsAtomEntry
29
29
  end
30
30
  end
31
31
  end
@@ -1,63 +1,67 @@
1
- require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
1
+ require 'spec_helper'
2
2
 
3
3
  describe Feedjira::Parser::ITunesRSSItem do
4
4
  before(:each) do
5
- # I don't really like doing it this way because these unit test should only rely on ITunesRssItem,
6
- # but this is actually how it should work. You would never just pass entry xml straight to the ITunesRssItem
5
+ # I don't really like doing it this way because these unit test should only
6
+ # rely on ITunesRssItem, but this is actually how it should work. You would
7
+ # never just pass entry xml straight to the ITunesRssItem
7
8
  @item = Feedjira::Parser::ITunesRSS.parse(sample_itunes_feed).entries.first
8
9
  end
9
10
 
10
- it "should parse the title" do
11
- expect(@item.title).to eq "Shake Shake Shake Your Spices"
11
+ it 'should parse the title' do
12
+ expect(@item.title).to eq 'Shake Shake Shake Your Spices'
12
13
  end
13
14
 
14
- it "should parse the author" do
15
- expect(@item.itunes_author).to eq "John Doe"
15
+ it 'should parse the author' do
16
+ expect(@item.itunes_author).to eq 'John Doe'
16
17
  end
17
18
 
18
- it "should parse the subtitle" do
19
- expect(@item.itunes_subtitle).to eq "A short primer on table spices"
19
+ it 'should parse the subtitle' do
20
+ expect(@item.itunes_subtitle).to eq 'A short primer on table spices'
20
21
  end
21
22
 
22
- it "should parse the summary" do
23
- expect(@item.itunes_summary).to eq "This week we talk about salt and pepper shakers, comparing and contrasting pour rates, construction materials, and overall aesthetics. Come and join the party!"
23
+ it 'should parse the summary' do
24
+ summary = 'This week we talk about salt and pepper shakers, comparing and contrasting pour rates, construction materials, and overall aesthetics. Come and join the party!' # rubocop:disable Metrics/LineLength
25
+ expect(@item.itunes_summary).to eq summary
24
26
  end
25
27
 
26
- it "should parse the enclosure" do
27
- expect(@item.enclosure_length).to eq "8727310"
28
- expect(@item.enclosure_type).to eq "audio/x-m4a"
29
- expect(@item.enclosure_url).to eq "http://example.com/podcasts/everything/AllAboutEverythingEpisode3.m4a"
28
+ it 'should parse the enclosure' do
29
+ expect(@item.enclosure_length).to eq '8727310'
30
+ expect(@item.enclosure_type).to eq 'audio/x-m4a'
31
+ expect(@item.enclosure_url).to eq 'http://example.com/podcasts/everything/AllAboutEverythingEpisode3.m4a'
30
32
  end
31
33
 
32
- it "should parse the guid as id" do
33
- expect(@item.id).to eq "http://example.com/podcasts/archive/aae20050615.m4a"
34
+ it 'should parse the guid as id' do
35
+ expect(@item.id).to eq 'http://example.com/podcasts/archive/aae20050615.m4a'
34
36
  end
35
37
 
36
- it "should parse the published date" do
37
- expect(@item.published).to eq Time.parse_safely("Wed Jun 15 19:00:00 UTC 2005")
38
+ it 'should parse the published date' do
39
+ published = Time.parse_safely 'Wed Jun 15 19:00:00 UTC 2005'
40
+ expect(@item.published).to eq published
38
41
  end
39
42
 
40
- it "should parse the duration" do
41
- expect(@item.itunes_duration).to eq "7:04"
43
+ it 'should parse the duration' do
44
+ expect(@item.itunes_duration).to eq '7:04'
42
45
  end
43
46
 
44
- it "should parse the keywords" do
45
- expect(@item.itunes_keywords).to eq "salt, pepper, shaker, exciting"
47
+ it 'should parse the keywords' do
48
+ expect(@item.itunes_keywords).to eq 'salt, pepper, shaker, exciting'
46
49
  end
47
50
 
48
- it "should parse the image" do
49
- expect(@item.itunes_image).to eq "http://example.com/podcasts/everything/AllAboutEverything.jpg"
51
+ it 'should parse the image' do
52
+ expect(@item.itunes_image).to eq 'http://example.com/podcasts/everything/AllAboutEverything.jpg'
50
53
  end
51
54
 
52
- it "should parse the order" do
55
+ it 'should parse the order' do
53
56
  expect(@item.itunes_order).to eq '12'
54
57
  end
55
58
 
56
- it "should parse the closed captioned flag" do
59
+ it 'should parse the closed captioned flag' do
57
60
  expect(@item.itunes_closed_captioned).to eq 'yes'
58
61
  end
59
62
 
60
- it "should parse the encoded content" do
61
- expect(@item.content).to eq "<p><strong>TOPIC</strong>: Gooseneck Options</p>"
63
+ it 'should parse the encoded content' do
64
+ content = '<p><strong>TOPIC</strong>: Gooseneck Options</p>'
65
+ expect(@item.content).to eq content
62
66
  end
63
67
  end
@@ -1,18 +1,19 @@
1
- require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
1
+ require 'spec_helper'
2
2
 
3
3
  describe Feedjira::Parser::ITunesRSSOwner do
4
4
  before(:each) do
5
- # I don't really like doing it this way because these unit test should only rely on RSSEntry,
6
- # but this is actually how it should work. You would never just pass entry xml straight to the ITunesRssOwner
7
- @owner = Feedjira::Parser::ITunesRSS.parse(sample_itunes_feed).itunes_owners.first
5
+ # I don't really like doing it this way because these unit test should only
6
+ # rely on RSSEntry, but this is actually how it should work. You would
7
+ # never just pass entry xml straight to the ITunesRssOwner
8
+ feed = Feedjira::Parser::ITunesRSS.parse sample_itunes_feed
9
+ @owner = feed.itunes_owners.first
8
10
  end
9
11
 
10
- it "should parse the name" do
11
- expect(@owner.name).to eq "John Doe"
12
+ it 'should parse the name' do
13
+ expect(@owner.name).to eq 'John Doe'
12
14
  end
13
15
 
14
- it "should parse the email" do
15
- expect(@owner.email).to eq "john.doe@example.com"
16
+ it 'should parse the email' do
17
+ expect(@owner.email).to eq 'john.doe@example.com'
16
18
  end
17
-
18
19
  end
@@ -1,62 +1,115 @@
1
- require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
1
+ require 'spec_helper'
2
2
 
3
- describe Feedjira::Parser::ITunesRSS do
4
- describe "#will_parse?" do
5
- it "should return true for an itunes RSS feed" do
6
- expect(Feedjira::Parser::ITunesRSS).to be_able_to_parse(sample_itunes_feed)
3
+ module Feedjira::Parser
4
+ describe '#will_parse?' do
5
+ it 'should return true for an itunes RSS feed' do
6
+ expect(ITunesRSS).to be_able_to_parse(sample_itunes_feed)
7
7
  end
8
8
 
9
- it "should return true for an itunes RSS feed with spaces between attribute names, equals sign, and values" do
10
- expect(Feedjira::Parser::ITunesRSS).to be_able_to_parse(sample_itunes_feed_with_spaces)
9
+ it 'should return true for an itunes RSS feed with spaces between attribute names, equals sign, and values' do # rubocop:disable Metrics/LineLength
10
+ expect(ITunesRSS).to be_able_to_parse(sample_itunes_feed_with_spaces)
11
11
  end
12
12
 
13
- it "should return fase for an atom feed" do
14
- expect(Feedjira::Parser::ITunesRSS).to_not be_able_to_parse(sample_atom_feed)
13
+ it 'should return true for an itunes RSS feed with single-quoted attributes' do # rubocop:disable Metrics/LineLength
14
+ expect(ITunesRSS).to be_able_to_parse(sample_itunes_feed_with_single_quotes) # rubocop:disable Metrics/LineLength
15
15
  end
16
16
 
17
- it "should return false for an rss feedburner feed" do
18
- expect(Feedjira::Parser::ITunesRSS).to_not be_able_to_parse(sample_rss_feed_burner_feed)
17
+ it 'should return fase for an atom feed' do
18
+ expect(ITunesRSS).to_not be_able_to_parse(sample_atom_feed)
19
+ end
20
+
21
+ it 'should return false for an rss feedburner feed' do
22
+ expect(ITunesRSS).to_not be_able_to_parse(sample_rss_feed_burner_feed)
19
23
  end
20
24
  end
21
25
 
22
- describe "parsing" do
26
+ describe 'parsing' do
23
27
  before(:each) do
24
- @feed = Feedjira::Parser::ITunesRSS.parse(sample_itunes_feed)
28
+ @feed = ITunesRSS.parse(sample_itunes_feed)
29
+ end
30
+
31
+ it 'should parse the ttl' do
32
+ expect(@feed.ttl).to eq '60'
33
+ end
34
+
35
+ it 'should parse the last build date' do
36
+ expect(@feed.last_built).to eq 'Sat, 07 Sep 2002 09:42:31 GMT'
25
37
  end
26
38
 
27
- it "should parse the subtitle" do
28
- expect(@feed.itunes_subtitle).to eq "A show about everything"
39
+ it 'should parse the subtitle' do
40
+ expect(@feed.itunes_subtitle).to eq 'A show about everything'
29
41
  end
30
42
 
31
- it "should parse the author" do
32
- expect(@feed.itunes_author).to eq "John Doe"
43
+ it 'should parse the author' do
44
+ expect(@feed.itunes_author).to eq 'John Doe'
33
45
  end
34
46
 
35
- it "should parse an owner" do
47
+ it 'should parse an owner' do
36
48
  expect(@feed.itunes_owners.size).to eq 1
37
49
  end
38
50
 
39
- it "should parse an image" do
40
- expect(@feed.itunes_image).to eq "http://example.com/podcasts/everything/AllAboutEverything.jpg"
51
+ it 'should parse an image' do
52
+ expect(@feed.itunes_image).to eq 'http://example.com/podcasts/everything/AllAboutEverything.jpg'
53
+ end
54
+
55
+ it 'should parse the image url' do
56
+ expect(@feed.image.url).to eq 'http://example.com/podcasts/everything/AllAboutEverything.jpg'
57
+ end
58
+
59
+ it 'should parse the image title' do
60
+ expect(@feed.image.title).to eq 'All About Everything'
61
+ end
62
+
63
+ it 'should parse the image link' do
64
+ expect(@feed.image.link).to eq 'http://www.example.com/podcasts/everything/index.html'
65
+ end
66
+
67
+ it 'should parse the image width' do
68
+ expect(@feed.image.width).to eq '88'
69
+ end
70
+
71
+ it 'should parse the image height' do
72
+ expect(@feed.image.height).to eq '31'
73
+ end
74
+
75
+ it 'should parse the image description' do
76
+ description = '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' # rubocop:disable Metrics/LineLength
77
+ expect(@feed.image.description).to eq description
78
+ end
79
+
80
+ it 'should parse categories' do
81
+ expect(@feed.itunes_categories).to eq [
82
+ 'Technology',
83
+ 'Gadgets',
84
+ 'TV & Film',
85
+ 'Arts',
86
+ 'Design',
87
+ 'Food'
88
+ ]
89
+
90
+ expect(@feed.itunes_category_paths).to eq [
91
+ %w(Technology Gadgets),
92
+ ['TV & Film'],
93
+ %w(Arts Design),
94
+ %w(Arts Food)
95
+ ]
41
96
  end
42
97
 
43
- it "should parse categories" do
44
- expect(@feed.itunes_categories.size).to eq 3
45
- expect(@feed.itunes_categories[0]).to eq "Technology"
46
- expect(@feed.itunes_categories[1]).to eq "Gadgets"
47
- expect(@feed.itunes_categories[2]).to eq "TV & Film"
98
+ it 'should parse the summary' do
99
+ summary = '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' # rubocop:disable Metrics/LineLength
100
+ expect(@feed.itunes_summary).to eq summary
48
101
  end
49
102
 
50
- it "should parse the summary" do
51
- expect(@feed.itunes_summary).to eq "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"
103
+ it 'should parse the complete tag' do
104
+ expect(@feed.itunes_complete).to eq 'yes'
52
105
  end
53
106
 
54
- it "should parse entries" do
107
+ it 'should parse entries' do
55
108
  expect(@feed.entries.size).to eq 3
56
109
  end
57
110
 
58
- it "should parse the new-feed-url" do
59
- expect(@feed.itunes_new_feed_url).to eq "http://example.com/new.xml"
111
+ it 'should parse the new-feed-url' do
112
+ expect(@feed.itunes_new_feed_url).to eq 'http://example.com/new.xml'
60
113
  end
61
114
  end
62
115
  end