feedjira 3.2.0 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/general-issue.md +8 -0
  3. data/.github/workflows/ruby.yml +1 -1
  4. data/.rubocop.yml +33 -1
  5. data/CHANGELOG.md +13 -0
  6. data/Gemfile +0 -3
  7. data/README.md +1 -2
  8. data/feedjira.gemspec +7 -3
  9. data/lib/feedjira/core_ext/date.rb +3 -2
  10. data/lib/feedjira/core_ext/time.rb +1 -1
  11. data/lib/feedjira/date_time_utilities/date_time_language_parser.rb +1 -1
  12. data/lib/feedjira/feed_utilities.rb +3 -3
  13. data/lib/feedjira/parser/atom_feed_burner.rb +1 -1
  14. data/lib/feedjira/parser/atom_google_alerts_entry.rb +2 -0
  15. data/lib/feedjira/parser/atom_youtube.rb +2 -2
  16. data/lib/feedjira/parser/google_docs_atom.rb +1 -1
  17. data/lib/feedjira/parser/itunes_rss_category.rb +2 -2
  18. data/lib/feedjira/parser/podlove_chapter.rb +2 -2
  19. data/lib/feedjira/parser/rss.rb +1 -1
  20. data/lib/feedjira/parser/rss_feed_burner.rb +2 -2
  21. data/lib/feedjira/rss_entry_utilities.rb +5 -1
  22. data/lib/feedjira/version.rb +1 -1
  23. data/lib/feedjira.rb +2 -2
  24. data/spec/feedjira/feed_spec.rb +11 -10
  25. data/spec/feedjira/{date_time_utilities_spec.rb → feed_utilities_date_time_spec.rb} +8 -8
  26. data/spec/feedjira/{feed_entry_utilities_spec.rb → feed_utilities_entry_spec.rb} +9 -9
  27. data/spec/feedjira/feed_utilities_spec.rb +37 -42
  28. data/spec/feedjira/parser/atom_entry_spec.rb +16 -16
  29. data/spec/feedjira/parser/atom_feed_burner_entry_spec.rb +10 -10
  30. data/spec/feedjira/parser/atom_feed_burner_spec.rb +26 -26
  31. data/spec/feedjira/parser/atom_google_alerts_entry_spec.rb +6 -6
  32. data/spec/feedjira/parser/atom_google_alerts_spec.rb +13 -13
  33. data/spec/feedjira/parser/atom_spec.rb +23 -23
  34. data/spec/feedjira/parser/atom_youtube_entry_spec.rb +19 -19
  35. data/spec/feedjira/parser/atom_youtube_spec.rb +13 -13
  36. data/spec/feedjira/parser/google_docs_atom_entry_spec.rb +3 -3
  37. data/spec/feedjira/parser/google_docs_atom_spec.rb +8 -8
  38. data/spec/feedjira/parser/{itunes_rss_item_spec.rb → i_tunes_rss_item_spec.rb} +18 -18
  39. data/spec/feedjira/parser/{itunes_rss_owner_spec.rb → i_tunes_rss_owner_spec.rb} +3 -3
  40. data/spec/feedjira/parser/itunes_rss_spec.rb +26 -26
  41. data/spec/feedjira/parser/json_feed_item_spec.rb +11 -11
  42. data/spec/feedjira/parser/json_feed_spec.rb +14 -14
  43. data/spec/feedjira/parser/podlove_chapter_spec.rb +7 -7
  44. data/spec/feedjira/parser/rss_entry_spec.rb +26 -20
  45. data/spec/feedjira/parser/rss_feed_burner_entry_spec.rb +16 -15
  46. data/spec/feedjira/parser/rss_feed_burner_spec.rb +17 -17
  47. data/spec/feedjira/parser/rss_spec.rb +25 -25
  48. data/spec/feedjira/preprocessor_spec.rb +3 -3
  49. data/spec/feedjira_spec.rb +41 -41
  50. data/spec/sample_feeds/RSSWithComments.xml +277 -0
  51. data/spec/sample_feeds.rb +2 -1
  52. metadata +68 -77
@@ -5,72 +5,72 @@ require "spec_helper"
5
5
  module Feedjira
6
6
  module Parser
7
7
  describe "#will_parse?" do
8
- it "should return true for an atom feed" do
8
+ it "returns true for an atom feed" do
9
9
  expect(Atom).to be_able_to_parse(sample_atom_feed)
10
10
  end
11
11
 
12
- it "should return false for an rdf feed" do
13
- expect(Atom).to_not be_able_to_parse(sample_rdf_feed)
12
+ it "returns false for an rdf feed" do
13
+ expect(Atom).not_to be_able_to_parse(sample_rdf_feed)
14
14
  end
15
15
 
16
- it "should return false for an rss feedburner feed" do
17
- expect(Atom).to_not be_able_to_parse(sample_rss_feed_burner_feed)
16
+ it "returns false for an rss feedburner feed" do
17
+ expect(Atom).not_to be_able_to_parse(sample_rss_feed_burner_feed)
18
18
  end
19
19
 
20
- it "should return true for an atom feed that has line breaks in between attributes in the <feed> node" do
20
+ it "returns true for an atom feed that has line breaks in between attributes in the <feed> node" do
21
21
  expect(Atom).to be_able_to_parse(sample_atom_feed_line_breaks)
22
22
  end
23
23
  end
24
24
 
25
25
  describe "parsing" do
26
- before(:each) do
26
+ before do
27
27
  @feed = Atom.parse(sample_atom_feed)
28
28
  end
29
29
 
30
- it "should parse the title" do
30
+ it "parses the title" do
31
31
  expect(@feed.title).to eq "Amazon Web Services Blog"
32
32
  end
33
33
 
34
- it "should parse the description" do
34
+ it "parses the description" do
35
35
  description = "Amazon Web Services, Products, Tools, and Developer Information..."
36
36
  expect(@feed.description).to eq description
37
37
  end
38
38
 
39
- it "should parse the icon url" do
39
+ it "parses the icon url" do
40
40
  feed_with_icon = Atom.parse(load_sample("SamRuby.xml"))
41
41
  expect(feed_with_icon.icon).to eq "../favicon.ico"
42
42
  end
43
43
 
44
- it "should parse the url" do
44
+ it "parses the url" do
45
45
  expect(@feed.url).to eq "http://aws.typepad.com/aws/"
46
46
  end
47
47
 
48
- it "should parse the url even when it doesn't have the type='text/html' attribute" do
48
+ it "parses the url even when it doesn't have the type='text/html' attribute" do
49
49
  xml = load_sample "atom_with_link_tag_for_url_unmarked.xml"
50
50
  feed = Atom.parse xml
51
51
  expect(feed.url).to eq "http://www.innoq.com/planet/"
52
52
  end
53
53
 
54
- it "should parse the feed_url even when it doesn't have the type='application/atom+xml' attribute" do
54
+ it "parses the feed_url even when it doesn't have the type='application/atom+xml' attribute" do
55
55
  feed = Atom.parse(load_sample("atom_with_link_tag_for_url_unmarked.xml"))
56
56
  expect(feed.feed_url).to eq "http://www.innoq.com/planet/atom.xml"
57
57
  end
58
58
 
59
- it "should parse the feed_url" do
59
+ it "parses the feed_url" do
60
60
  expect(@feed.feed_url).to eq "http://aws.typepad.com/aws/atom.xml"
61
61
  end
62
62
 
63
- it "should parse no hub urls" do
63
+ it "parses no hub urls" do
64
64
  expect(@feed.hubs.count).to eq 0
65
65
  end
66
66
 
67
- it "should parse the hub urls" do
67
+ it "parses the hub urls" do
68
68
  feed_with_hub = Atom.parse(load_sample("SamRuby.xml"))
69
69
  expect(feed_with_hub.hubs.count).to eq 1
70
70
  expect(feed_with_hub.hubs.first).to eq "http://pubsubhubbub.appspot.com/"
71
71
  end
72
72
 
73
- it "should parse entries" do
73
+ it "parses entries" do
74
74
  expect(@feed.entries.size).to eq 10
75
75
  end
76
76
  end
@@ -89,7 +89,7 @@ module Feedjira
89
89
  expect(entry.content).to match(/\A<p/)
90
90
  end
91
91
 
92
- it "should not duplicate content when there are divs in content" do
92
+ it "does not duplicate content when there are divs in content" do
93
93
  Atom.preprocess_xml = true
94
94
 
95
95
  feed = Atom.parse sample_duplicate_content_atom_feed
@@ -99,25 +99,25 @@ module Feedjira
99
99
  end
100
100
 
101
101
  describe "parsing url and feed_url" do
102
- before :each do
102
+ before do
103
103
  @feed = Atom.parse(sample_atom_middleman_feed)
104
104
  end
105
105
 
106
- it "should parse url" do
106
+ it "parses url" do
107
107
  expect(@feed.url).to eq "http://feedjira.com/blog"
108
108
  end
109
109
 
110
- it "should parse feed_url" do
110
+ it "parses feed_url" do
111
111
  expect(@feed.feed_url).to eq "http://feedjira.com/blog/feed.xml"
112
112
  end
113
113
 
114
- it "should not parse links without the rel='self' attribute as feed_url" do
114
+ it "does not parse links without the rel='self' attribute as feed_url" do
115
115
  xml = load_sample "atom_simple_single_entry.xml"
116
116
  feed = Atom.parse xml
117
117
  expect(feed.feed_url).to be_nil
118
118
  end
119
119
 
120
- it "should not parse links with the rel='self' attribute as url" do
120
+ it "does not parse links with the rel='self' attribute as url" do
121
121
  xml = load_sample "atom_simple_single_entry_link_self.xml"
122
122
  feed = Atom.parse xml
123
123
  expect(feed.url).to be_nil
@@ -9,79 +9,79 @@ describe Feedjira::Parser::AtomYoutubeEntry do
9
9
  @entry = @feed.entries.first
10
10
  end
11
11
 
12
- it "should have the title" do
12
+ it "has the title" do
13
13
  expect(@entry.title).to eq "The Google app: Questions Title"
14
14
  end
15
15
 
16
- it "should have the url" do
16
+ it "has the url" do
17
17
  expect(@entry.url).to eq "http://www.youtube.com/watch?v=5shykyfmb28"
18
18
  end
19
19
 
20
- it "should have the entry id" do
20
+ it "has the entry id" do
21
21
  expect(@entry.entry_id).to eq "yt:video:5shykyfmb28"
22
22
  end
23
23
 
24
- it "should have the published date" do
24
+ it "has the published date" do
25
25
  expect(@entry.published).to eq Time.parse_safely("2015-05-04T00:01:27+00:00")
26
26
  end
27
27
 
28
- it "should have the updated date" do
28
+ it "has the updated date" do
29
29
  expect(@entry.updated).to eq Time.parse_safely("2015-05-13T17:38:30+00:00")
30
30
  end
31
31
 
32
- it "should have the content populated from the media:description element" do
32
+ it "has the content populated from the media:description element" do
33
33
  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"
34
34
  end
35
35
 
36
- it "should have the summary but blank" do
36
+ it "has the summary but blank" do
37
37
  expect(@entry.summary).to be_nil
38
38
  end
39
39
 
40
- it "should have the custom youtube video id" do
40
+ it "has the custom youtube video id" do
41
41
  expect(@entry.youtube_video_id).to eq "5shykyfmb28"
42
42
  end
43
43
 
44
- it "should have the custom media title" do
44
+ it "has the custom media title" do
45
45
  expect(@entry.media_title).to eq "The Google app: Questions"
46
46
  end
47
47
 
48
- it "should have the custom media url" do
48
+ it "has the custom media url" do
49
49
  expect(@entry.media_url).to eq "https://www.youtube.com/v/5shykyfmb28?version=3"
50
50
  end
51
51
 
52
- it "should have the custom media type" do
52
+ it "has the custom media type" do
53
53
  expect(@entry.media_type).to eq "application/x-shockwave-flash"
54
54
  end
55
55
 
56
- it "should have the custom media width" do
56
+ it "has the custom media width" do
57
57
  expect(@entry.media_width).to eq "640"
58
58
  end
59
59
 
60
- it "should have the custom media height" do
60
+ it "has the custom media height" do
61
61
  expect(@entry.media_height).to eq "390"
62
62
  end
63
63
 
64
- it "should have the custom media thumbnail url" do
64
+ it "has the custom media thumbnail url" do
65
65
  expect(@entry.media_thumbnail_url).to eq "https://i2.ytimg.com/vi/5shykyfmb28/hqdefault.jpg"
66
66
  end
67
67
 
68
- it "should have the custom media thumbnail width" do
68
+ it "has the custom media thumbnail width" do
69
69
  expect(@entry.media_thumbnail_width).to eq "480"
70
70
  end
71
71
 
72
- it "should have the custom media thumbnail height" do
72
+ it "has the custom media thumbnail height" do
73
73
  expect(@entry.media_thumbnail_height).to eq "360"
74
74
  end
75
75
 
76
- it "should have the custom media star count" do
76
+ it "has the custom media star count" do
77
77
  expect(@entry.media_star_count).to eq "3546"
78
78
  end
79
79
 
80
- it "should have the custom media star average" do
80
+ it "has the custom media star average" do
81
81
  expect(@entry.media_star_average).to eq "4.79"
82
82
  end
83
83
 
84
- it "should have the custom media views" do
84
+ it "has the custom media views" do
85
85
  expect(@entry.media_views).to eq "251497"
86
86
  end
87
87
  end
@@ -4,41 +4,41 @@ require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
4
4
 
5
5
  describe Feedjira::Parser::AtomYoutube do
6
6
  describe "#will_parse?" do
7
- it "should return true for an atom youtube feed" do
8
- expect(Feedjira::Parser::AtomYoutube).to be_able_to_parse(sample_youtube_atom_feed)
7
+ it "returns true for an atom youtube feed" do
8
+ expect(described_class).to be_able_to_parse(sample_youtube_atom_feed)
9
9
  end
10
10
 
11
- it "should return fase for an atom feed" do
12
- expect(Feedjira::Parser::AtomYoutube).to_not be_able_to_parse(sample_atom_feed)
11
+ it "returns fase for an atom feed" do
12
+ expect(described_class).not_to be_able_to_parse(sample_atom_feed)
13
13
  end
14
14
 
15
- it "should return false for an rss feedburner feed" do
16
- expect(Feedjira::Parser::AtomYoutube).to_not be_able_to_parse(sample_rss_feed_burner_feed)
15
+ it "returns false for an rss feedburner feed" do
16
+ expect(described_class).not_to be_able_to_parse(sample_rss_feed_burner_feed)
17
17
  end
18
18
  end
19
19
 
20
20
  describe "parsing" do
21
- before(:each) do
22
- @feed = Feedjira::Parser::AtomYoutube.parse(sample_youtube_atom_feed)
21
+ before do
22
+ @feed = described_class.parse(sample_youtube_atom_feed)
23
23
  end
24
24
 
25
- it "should parse the title" do
25
+ it "parses the title" do
26
26
  expect(@feed.title).to eq "Google"
27
27
  end
28
28
 
29
- it "should parse the author" do
29
+ it "parses the author" do
30
30
  expect(@feed.author).to eq "Google Author"
31
31
  end
32
32
 
33
- it "should parse the url" do
33
+ it "parses the url" do
34
34
  expect(@feed.url).to eq "http://www.youtube.com/user/Google"
35
35
  end
36
36
 
37
- it "should parse the feed_url" do
37
+ it "parses the feed_url" do
38
38
  expect(@feed.feed_url).to eq "http://www.youtube.com/feeds/videos.xml?user=google"
39
39
  end
40
40
 
41
- it "should parse the YouTube channel id" do
41
+ it "parses the YouTube channel id" do
42
42
  expect(@feed.youtube_channel_id).to eq "UCK8sQmJBp8GCxrOtXWBpyEA"
43
43
  end
44
44
  end
@@ -10,15 +10,15 @@ describe Feedjira::Parser::GoogleDocsAtomEntry do
10
10
  @entry = @feed.entries.first
11
11
  end
12
12
 
13
- it "should have the custom checksum element" do
13
+ it "has the custom checksum element" do
14
14
  expect(@entry.checksum).to eq "2b01142f7481c7b056c4b410d28f33cf"
15
15
  end
16
16
 
17
- it "should have the custom filename element" do
17
+ it "has the custom filename element" do
18
18
  expect(@entry.original_filename).to eq "MyFile.pdf"
19
19
  end
20
20
 
21
- it "should have the custom suggested filename element" do
21
+ it "has the custom suggested filename element" do
22
22
  expect(@entry.suggested_filename).to eq "TaxDocument.pdf"
23
23
  end
24
24
  end
@@ -5,12 +5,12 @@ require "spec_helper"
5
5
  module Feedjira
6
6
  module Parser
7
7
  describe ".able_to_parser?" do
8
- it "should return true for Google Docs feed" do
8
+ it "returns true for Google Docs feed" do
9
9
  expect(GoogleDocsAtom).to be_able_to_parse(sample_google_docs_list_feed)
10
10
  end
11
11
 
12
- it "should not be able to parse another Atom feed" do
13
- expect(GoogleDocsAtom).to_not be_able_to_parse(sample_atom_feed)
12
+ it "is not able to parse another Atom feed" do
13
+ expect(GoogleDocsAtom).not_to be_able_to_parse(sample_atom_feed)
14
14
  end
15
15
  end
16
16
 
@@ -19,15 +19,15 @@ module Feedjira
19
19
  @feed = GoogleDocsAtom.parse(sample_google_docs_list_feed)
20
20
  end
21
21
 
22
- it "should return a bunch of objects" do
23
- expect(@feed.entries).to_not be_empty
22
+ it "returns a bunch of objects" do
23
+ expect(@feed.entries).not_to be_empty
24
24
  end
25
25
 
26
- it "should populate a title, interhited from the Atom entry" do
27
- expect(@feed.title).to_not be_nil
26
+ it "populates a title, interhited from the Atom entry" do
27
+ expect(@feed.title).not_to be_nil
28
28
  end
29
29
 
30
- it "should return a bunch of entries of type GoogleDocsAtomEntry" do
30
+ it "returns a bunch of entries of type GoogleDocsAtomEntry" do
31
31
  expect(@feed.entries.first).to be_a GoogleDocsAtomEntry
32
32
  end
33
33
  end
@@ -3,82 +3,82 @@
3
3
  require "spec_helper"
4
4
 
5
5
  describe Feedjira::Parser::ITunesRSSItem do
6
- before(:each) do
6
+ before do
7
7
  # I don't really like doing it this way because these unit test should only
8
8
  # rely on ITunesRssItem, but this is actually how it should work. You would
9
9
  # never just pass entry xml straight to the ITunesRssItem
10
10
  @item = Feedjira::Parser::ITunesRSS.parse(sample_itunes_feed).entries.first
11
11
  end
12
12
 
13
- it "should parse the title" do
13
+ it "parses the title" do
14
14
  expect(@item.title).to eq "Shake Shake Shake Your Spices"
15
15
  end
16
16
 
17
- it "should parse the itunes title" do
17
+ it "parses the itunes title" do
18
18
  expect(@item.itunes_title).to eq "Shake Shake Shake Your Spices"
19
19
  end
20
20
 
21
- it "should parse the author" do
21
+ it "parses the author" do
22
22
  expect(@item.itunes_author).to eq "John Doe"
23
23
  end
24
24
 
25
- it "should parse the subtitle" do
25
+ it "parses the subtitle" do
26
26
  expect(@item.itunes_subtitle).to eq "A short primer on table spices"
27
27
  end
28
28
 
29
- it "should parse the summary" do
29
+ it "parses the summary" do
30
30
  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!"
31
31
  expect(@item.itunes_summary).to eq summary
32
32
  end
33
33
 
34
- it "should parse the itunes season" do
34
+ it "parses the itunes season" do
35
35
  expect(@item.itunes_season).to eq "1"
36
36
  end
37
37
 
38
- it "should parse the itunes episode number" do
38
+ it "parses the itunes episode number" do
39
39
  expect(@item.itunes_episode).to eq "3"
40
40
  end
41
41
 
42
- it "should parse the itunes episode type" do
42
+ it "parses the itunes episode type" do
43
43
  expect(@item.itunes_episode_type).to eq "full"
44
44
  end
45
45
 
46
- it "should parse the enclosure" do
46
+ it "parses the enclosure" do
47
47
  expect(@item.enclosure_length).to eq "8727310"
48
48
  expect(@item.enclosure_type).to eq "audio/x-m4a"
49
49
  expect(@item.enclosure_url).to eq "http://example.com/podcasts/everything/AllAboutEverythingEpisode3.m4a"
50
50
  end
51
51
 
52
- it "should parse the guid as id" do
52
+ it "parses the guid as id" do
53
53
  expect(@item.id).to eq "http://example.com/podcasts/archive/aae20050615.m4a"
54
54
  end
55
55
 
56
- it "should parse the published date" do
56
+ it "parses the published date" do
57
57
  published = Time.parse_safely "Wed Jun 15 19:00:00 UTC 2005"
58
58
  expect(@item.published).to eq published
59
59
  end
60
60
 
61
- it "should parse the duration" do
61
+ it "parses the duration" do
62
62
  expect(@item.itunes_duration).to eq "7:04"
63
63
  end
64
64
 
65
- it "should parse the keywords" do
65
+ it "parses the keywords" do
66
66
  expect(@item.itunes_keywords).to eq "salt, pepper, shaker, exciting"
67
67
  end
68
68
 
69
- it "should parse the image" do
69
+ it "parses the image" do
70
70
  expect(@item.itunes_image).to eq "http://example.com/podcasts/everything/AllAboutEverything.jpg"
71
71
  end
72
72
 
73
- it "should parse the order" do
73
+ it "parses the order" do
74
74
  expect(@item.itunes_order).to eq "12"
75
75
  end
76
76
 
77
- it "should parse the closed captioned flag" do
77
+ it "parses the closed captioned flag" do
78
78
  expect(@item.itunes_closed_captioned).to eq "yes"
79
79
  end
80
80
 
81
- it "should parse the encoded content" do
81
+ it "parses the encoded content" do
82
82
  content = "<p><strong>TOPIC</strong>: Gooseneck Options</p>"
83
83
  expect(@item.content).to eq content
84
84
  end
@@ -3,7 +3,7 @@
3
3
  require "spec_helper"
4
4
 
5
5
  describe Feedjira::Parser::ITunesRSSOwner do
6
- before(:each) do
6
+ before do
7
7
  # I don't really like doing it this way because these unit test should only
8
8
  # rely on RSSEntry, but this is actually how it should work. You would
9
9
  # never just pass entry xml straight to the ITunesRssOwner
@@ -11,11 +11,11 @@ describe Feedjira::Parser::ITunesRSSOwner do
11
11
  @owner = feed.itunes_owners.first
12
12
  end
13
13
 
14
- it "should parse the name" do
14
+ it "parses the name" do
15
15
  expect(@owner.name).to eq "John Doe"
16
16
  end
17
17
 
18
- it "should parse the email" do
18
+ it "parses the email" do
19
19
  expect(@owner.email).to eq "john.doe@example.com"
20
20
  end
21
21
  end
@@ -5,82 +5,82 @@ require "spec_helper"
5
5
  module Feedjira
6
6
  module Parser
7
7
  describe "#will_parse?" do
8
- it "should return true for an itunes RSS feed" do
8
+ it "returns true for an itunes RSS feed" do
9
9
  expect(ITunesRSS).to be_able_to_parse(sample_itunes_feed)
10
10
  end
11
11
 
12
- it "should return true for an itunes RSS feed with spaces between attribute names, equals sign, and values" do
12
+ it "returns true for an itunes RSS feed with spaces between attribute names, equals sign, and values" do
13
13
  expect(ITunesRSS).to be_able_to_parse(sample_itunes_feed_with_spaces)
14
14
  end
15
15
 
16
- it "should return true for an itunes RSS feed with single-quoted attributes" do
16
+ it "returns true for an itunes RSS feed with single-quoted attributes" do
17
17
  expect(ITunesRSS).to be_able_to_parse(sample_itunes_feed_with_single_quotes)
18
18
  end
19
19
 
20
- it "should return fase for an atom feed" do
21
- expect(ITunesRSS).to_not be_able_to_parse(sample_atom_feed)
20
+ it "returns fase for an atom feed" do
21
+ expect(ITunesRSS).not_to be_able_to_parse(sample_atom_feed)
22
22
  end
23
23
 
24
- it "should return false for an rss feedburner feed" do
25
- expect(ITunesRSS).to_not be_able_to_parse(sample_rss_feed_burner_feed)
24
+ it "returns false for an rss feedburner feed" do
25
+ expect(ITunesRSS).not_to be_able_to_parse(sample_rss_feed_burner_feed)
26
26
  end
27
27
  end
28
28
 
29
29
  describe "parsing" do
30
- before(:each) do
30
+ before do
31
31
  @feed = ITunesRSS.parse(sample_itunes_feed)
32
32
  end
33
33
 
34
- it "should parse the ttl" do
34
+ it "parses the ttl" do
35
35
  expect(@feed.ttl).to eq "60"
36
36
  end
37
37
 
38
- it "should parse the last build date" do
38
+ it "parses the last build date" do
39
39
  expect(@feed.last_built).to eq "Sat, 07 Sep 2002 09:42:31 GMT"
40
40
  end
41
41
 
42
- it "should parse the subtitle" do
42
+ it "parses the subtitle" do
43
43
  expect(@feed.itunes_subtitle).to eq "A show about everything"
44
44
  end
45
45
 
46
- it "should parse the author" do
46
+ it "parses the author" do
47
47
  expect(@feed.itunes_author).to eq "John Doe"
48
48
  end
49
49
 
50
- it "should parse an owner" do
50
+ it "parses an owner" do
51
51
  expect(@feed.itunes_owners.size).to eq 1
52
52
  end
53
53
 
54
- it "should parse an image" do
54
+ it "parses an image" do
55
55
  expect(@feed.itunes_image).to eq "http://example.com/podcasts/everything/AllAboutEverything.jpg"
56
56
  end
57
57
 
58
- it "should parse the image url" do
58
+ it "parses the image url" do
59
59
  expect(@feed.image.url).to eq "http://example.com/podcasts/everything/AllAboutEverything.jpg"
60
60
  end
61
61
 
62
- it "should parse the image title" do
62
+ it "parses the image title" do
63
63
  expect(@feed.image.title).to eq "All About Everything"
64
64
  end
65
65
 
66
- it "should parse the image link" do
66
+ it "parses the image link" do
67
67
  expect(@feed.image.link).to eq "http://www.example.com/podcasts/everything/index.html"
68
68
  end
69
69
 
70
- it "should parse the image width" do
70
+ it "parses the image width" do
71
71
  expect(@feed.image.width).to eq "88"
72
72
  end
73
73
 
74
- it "should parse the image height" do
74
+ it "parses the image height" do
75
75
  expect(@feed.image.height).to eq "31"
76
76
  end
77
77
 
78
- it "should parse the image description" do
78
+ it "parses the image description" do
79
79
  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"
80
80
  expect(@feed.image.description).to eq description
81
81
  end
82
82
 
83
- it "should parse categories" do
83
+ it "parses categories" do
84
84
  expect(@feed.itunes_categories).to eq [
85
85
  "Technology",
86
86
  "Gadgets",
@@ -98,24 +98,24 @@ module Feedjira
98
98
  ]
99
99
  end
100
100
 
101
- it "should parse the itunes type" do
101
+ it "parses the itunes type" do
102
102
  expect(@feed.itunes_type).to eq "episodic"
103
103
  end
104
104
 
105
- it "should parse the summary" do
105
+ it "parses the summary" do
106
106
  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"
107
107
  expect(@feed.itunes_summary).to eq summary
108
108
  end
109
109
 
110
- it "should parse the complete tag" do
110
+ it "parses the complete tag" do
111
111
  expect(@feed.itunes_complete).to eq "yes"
112
112
  end
113
113
 
114
- it "should parse entries" do
114
+ it "parses entries" do
115
115
  expect(@feed.entries.size).to eq 3
116
116
  end
117
117
 
118
- it "should parse the new-feed-url" do
118
+ it "parses the new-feed-url" do
119
119
  expect(@feed.itunes_new_feed_url).to eq "http://example.com/new.xml"
120
120
  end
121
121
  end