feedjira 3.2.0 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/general-issue.md +8 -0
- data/.rubocop.yml +32 -0
- data/Gemfile +0 -3
- data/feedjira.gemspec +6 -1
- data/lib/feedjira/core_ext/date.rb +1 -1
- data/lib/feedjira/core_ext/time.rb +1 -1
- data/lib/feedjira/date_time_utilities/date_time_language_parser.rb +1 -1
- data/lib/feedjira/feed_utilities.rb +3 -3
- data/lib/feedjira/parser/atom_feed_burner.rb +1 -1
- data/lib/feedjira/parser/atom_google_alerts_entry.rb +2 -0
- data/lib/feedjira/parser/atom_youtube.rb +2 -2
- data/lib/feedjira/parser/google_docs_atom.rb +1 -1
- data/lib/feedjira/parser/itunes_rss_category.rb +2 -2
- data/lib/feedjira/parser/podlove_chapter.rb +2 -2
- data/lib/feedjira/parser/rss.rb +1 -1
- data/lib/feedjira/parser/rss_feed_burner.rb +2 -2
- data/lib/feedjira/version.rb +1 -1
- data/lib/feedjira.rb +2 -2
- data/spec/feedjira/feed_spec.rb +11 -10
- data/spec/feedjira/{date_time_utilities_spec.rb → feed_utilities_date_time_spec.rb} +7 -7
- data/spec/feedjira/{feed_entry_utilities_spec.rb → feed_utilities_entry_spec.rb} +8 -8
- data/spec/feedjira/feed_utilities_spec.rb +35 -40
- data/spec/feedjira/parser/atom_entry_spec.rb +16 -16
- data/spec/feedjira/parser/atom_feed_burner_entry_spec.rb +10 -10
- data/spec/feedjira/parser/atom_feed_burner_spec.rb +26 -26
- data/spec/feedjira/parser/atom_google_alerts_entry_spec.rb +6 -6
- data/spec/feedjira/parser/atom_google_alerts_spec.rb +13 -13
- data/spec/feedjira/parser/atom_spec.rb +23 -23
- data/spec/feedjira/parser/atom_youtube_entry_spec.rb +19 -19
- data/spec/feedjira/parser/atom_youtube_spec.rb +13 -13
- data/spec/feedjira/parser/google_docs_atom_entry_spec.rb +3 -3
- data/spec/feedjira/parser/google_docs_atom_spec.rb +8 -8
- data/spec/feedjira/parser/{itunes_rss_item_spec.rb → i_tunes_rss_item_spec.rb} +18 -18
- data/spec/feedjira/parser/{itunes_rss_owner_spec.rb → i_tunes_rss_owner_spec.rb} +3 -3
- data/spec/feedjira/parser/itunes_rss_spec.rb +26 -26
- data/spec/feedjira/parser/json_feed_item_spec.rb +11 -11
- data/spec/feedjira/parser/json_feed_spec.rb +13 -13
- data/spec/feedjira/parser/podlove_chapter_spec.rb +7 -7
- data/spec/feedjira/parser/rss_entry_spec.rb +19 -19
- data/spec/feedjira/parser/rss_feed_burner_entry_spec.rb +15 -15
- data/spec/feedjira/parser/rss_feed_burner_spec.rb +17 -17
- data/spec/feedjira/parser/rss_spec.rb +24 -24
- data/spec/feedjira/preprocessor_spec.rb +3 -3
- data/spec/feedjira_spec.rb +41 -41
- metadata +69 -11
@@ -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 "
|
8
|
-
expect(
|
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 "
|
12
|
-
expect(
|
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 "
|
16
|
-
expect(
|
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
|
22
|
-
@feed =
|
21
|
+
before do
|
22
|
+
@feed = described_class.parse(sample_youtube_atom_feed)
|
23
23
|
end
|
24
24
|
|
25
|
-
it "
|
25
|
+
it "parses the title" do
|
26
26
|
expect(@feed.title).to eq "Google"
|
27
27
|
end
|
28
28
|
|
29
|
-
it "
|
29
|
+
it "parses the author" do
|
30
30
|
expect(@feed.author).to eq "Google Author"
|
31
31
|
end
|
32
32
|
|
33
|
-
it "
|
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 "
|
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 "
|
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 "
|
13
|
+
it "has the custom checksum element" do
|
14
14
|
expect(@entry.checksum).to eq "2b01142f7481c7b056c4b410d28f33cf"
|
15
15
|
end
|
16
16
|
|
17
|
-
it "
|
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 "
|
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 "
|
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 "
|
13
|
-
expect(GoogleDocsAtom).
|
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 "
|
23
|
-
expect(@feed.entries).
|
22
|
+
it "returns a bunch of objects" do
|
23
|
+
expect(@feed.entries).not_to be_empty
|
24
24
|
end
|
25
25
|
|
26
|
-
it "
|
27
|
-
expect(@feed.title).
|
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 "
|
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
|
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 "
|
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 "
|
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 "
|
21
|
+
it "parses the author" do
|
22
22
|
expect(@item.itunes_author).to eq "John Doe"
|
23
23
|
end
|
24
24
|
|
25
|
-
it "
|
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 "
|
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 "
|
34
|
+
it "parses the itunes season" do
|
35
35
|
expect(@item.itunes_season).to eq "1"
|
36
36
|
end
|
37
37
|
|
38
|
-
it "
|
38
|
+
it "parses the itunes episode number" do
|
39
39
|
expect(@item.itunes_episode).to eq "3"
|
40
40
|
end
|
41
41
|
|
42
|
-
it "
|
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 "
|
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 "
|
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 "
|
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 "
|
61
|
+
it "parses the duration" do
|
62
62
|
expect(@item.itunes_duration).to eq "7:04"
|
63
63
|
end
|
64
64
|
|
65
|
-
it "
|
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 "
|
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 "
|
73
|
+
it "parses the order" do
|
74
74
|
expect(@item.itunes_order).to eq "12"
|
75
75
|
end
|
76
76
|
|
77
|
-
it "
|
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 "
|
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
|
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 "
|
14
|
+
it "parses the name" do
|
15
15
|
expect(@owner.name).to eq "John Doe"
|
16
16
|
end
|
17
17
|
|
18
|
-
it "
|
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 "
|
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 "
|
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 "
|
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 "
|
21
|
-
expect(ITunesRSS).
|
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 "
|
25
|
-
expect(ITunesRSS).
|
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
|
30
|
+
before do
|
31
31
|
@feed = ITunesRSS.parse(sample_itunes_feed)
|
32
32
|
end
|
33
33
|
|
34
|
-
it "
|
34
|
+
it "parses the ttl" do
|
35
35
|
expect(@feed.ttl).to eq "60"
|
36
36
|
end
|
37
37
|
|
38
|
-
it "
|
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 "
|
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 "
|
46
|
+
it "parses the author" do
|
47
47
|
expect(@feed.itunes_author).to eq "John Doe"
|
48
48
|
end
|
49
49
|
|
50
|
-
it "
|
50
|
+
it "parses an owner" do
|
51
51
|
expect(@feed.itunes_owners.size).to eq 1
|
52
52
|
end
|
53
53
|
|
54
|
-
it "
|
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 "
|
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 "
|
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 "
|
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 "
|
70
|
+
it "parses the image width" do
|
71
71
|
expect(@feed.image.width).to eq "88"
|
72
72
|
end
|
73
73
|
|
74
|
-
it "
|
74
|
+
it "parses the image height" do
|
75
75
|
expect(@feed.image.height).to eq "31"
|
76
76
|
end
|
77
77
|
|
78
|
-
it "
|
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 "
|
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 "
|
101
|
+
it "parses the itunes type" do
|
102
102
|
expect(@feed.itunes_type).to eq "episodic"
|
103
103
|
end
|
104
104
|
|
105
|
-
it "
|
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 "
|
110
|
+
it "parses the complete tag" do
|
111
111
|
expect(@feed.itunes_complete).to eq "yes"
|
112
112
|
end
|
113
113
|
|
114
|
-
it "
|
114
|
+
it "parses entries" do
|
115
115
|
expect(@feed.entries.size).to eq 3
|
116
116
|
end
|
117
117
|
|
118
|
-
it "
|
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
|
@@ -3,40 +3,40 @@
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
5
|
describe Feedjira::Parser::JSONFeedItem do
|
6
|
-
before
|
6
|
+
before do
|
7
7
|
# I don't really like doing it this way because these unit test should only
|
8
8
|
# rely on JSONFeed, but this is actually how it should work. You would
|
9
9
|
# never just pass entry json straight to the JSONFeedItem
|
10
10
|
@entry = Feedjira::Parser::JSONFeed.parse(sample_json_feed).entries.first
|
11
11
|
end
|
12
12
|
|
13
|
-
it "
|
13
|
+
it "parses the id" do
|
14
14
|
expect(@entry.id).to eq "http://inessential.com/2017/06/02/james_dempsey_and_the_breakpoints_benefi"
|
15
15
|
end
|
16
16
|
|
17
|
-
it "
|
17
|
+
it "parses the url" do
|
18
18
|
expect(@entry.url).to eq "http://inessential.com/2017/06/02/james_dempsey_and_the_breakpoints_benefi"
|
19
19
|
end
|
20
20
|
|
21
|
-
it "
|
21
|
+
it "parses the title" do
|
22
22
|
expect(@entry.title).to eq "James Dempsey and the Breakpoints Benefit App Camp for Girls"
|
23
23
|
end
|
24
24
|
|
25
|
-
it "
|
25
|
+
it "parses the content" do
|
26
26
|
content = "<p>On Wednesday night I know where I’ll be — playing keyboard for a few songs at the James Dempsey and the Breakpoints concert benefitting App Camp for Girls.</p>\n\n<p><a href=\"https://www.classy.org/events/-/e126329\">You should get tickets</a>. It’s a fun time for a great cause.</p>\n\n<p>Bonus: James writes about how <a href=\"http://jamesdempsey.net/2017/06/02/wwdc-in-san-jose-full-circle/\">this concert is full circle for him</a>. It’s a special night.</p>"
|
27
27
|
expect(@entry.content).to eq content
|
28
28
|
end
|
29
29
|
|
30
|
-
it "
|
30
|
+
it "parses the published date" do
|
31
31
|
published = Time.parse_safely "2017-06-02T22:05:47-07:00"
|
32
32
|
expect(@entry.published).to eq published
|
33
33
|
end
|
34
34
|
|
35
|
-
it "
|
35
|
+
it "supports each" do
|
36
36
|
expect(@entry).to respond_to :each
|
37
37
|
end
|
38
38
|
|
39
|
-
it "
|
39
|
+
it "is able to list out all the fields with each" do
|
40
40
|
all_fields = []
|
41
41
|
title_value = ""
|
42
42
|
@entry.each do |field, value|
|
@@ -64,17 +64,17 @@ describe Feedjira::Parser::JSONFeedItem do
|
|
64
64
|
expect(all_fields).to match_array expected_fields
|
65
65
|
end
|
66
66
|
|
67
|
-
it "
|
67
|
+
it "supports checking if a field exists in the entry" do
|
68
68
|
expect(@entry).to include "title"
|
69
69
|
expect(@entry).to include "url"
|
70
70
|
end
|
71
71
|
|
72
|
-
it "
|
72
|
+
it "allows access to fields with hash syntax" do
|
73
73
|
expect(@entry["title"]).to eq "James Dempsey and the Breakpoints Benefit App Camp for Girls"
|
74
74
|
expect(@entry["url"]).to eq "http://inessential.com/2017/06/02/james_dempsey_and_the_breakpoints_benefi"
|
75
75
|
end
|
76
76
|
|
77
|
-
it "
|
77
|
+
it "allows setting field values with hash syntax" do
|
78
78
|
@entry["title"] = "Foobar"
|
79
79
|
expect(@entry.title).to eq "Foobar"
|
80
80
|
end
|
@@ -5,49 +5,49 @@ require "spec_helper"
|
|
5
5
|
module Feedjira
|
6
6
|
module Parser
|
7
7
|
describe ".able_to_parse?" do
|
8
|
-
it "
|
8
|
+
it "returns true for a JSON feed" do
|
9
9
|
expect(JSONFeed).to be_able_to_parse(sample_json_feed)
|
10
10
|
end
|
11
11
|
|
12
|
-
it "
|
13
|
-
expect(JSONFeed).
|
12
|
+
it "returns false for an RSS feed" do
|
13
|
+
expect(JSONFeed).not_to be_able_to_parse(sample_rss_feed)
|
14
14
|
end
|
15
15
|
|
16
|
-
it "
|
17
|
-
expect(JSONFeed).
|
16
|
+
it "returns false for an Atom feed" do
|
17
|
+
expect(JSONFeed).not_to be_able_to_parse(sample_atom_feed)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
describe "parsing" do
|
22
|
-
before
|
22
|
+
before do
|
23
23
|
@feed = JSONFeed.parse(sample_json_feed)
|
24
24
|
end
|
25
25
|
|
26
|
-
it "
|
26
|
+
it "parses the version" do
|
27
27
|
expect(@feed.version).to eq "https://jsonfeed.org/version/1"
|
28
28
|
end
|
29
29
|
|
30
|
-
it "
|
30
|
+
it "parses the title" do
|
31
31
|
expect(@feed.title).to eq "inessential.com"
|
32
32
|
end
|
33
33
|
|
34
|
-
it "
|
34
|
+
it "parses the url" do
|
35
35
|
expect(@feed.url).to eq "http://inessential.com/"
|
36
36
|
end
|
37
37
|
|
38
|
-
it "
|
38
|
+
it "parses the feed_url" do
|
39
39
|
expect(@feed.feed_url).to eq "http://inessential.com/feed.json"
|
40
40
|
end
|
41
41
|
|
42
|
-
it "
|
42
|
+
it "parses the description" do
|
43
43
|
expect(@feed.description).to eq "Brent Simmons’s weblog."
|
44
44
|
end
|
45
45
|
|
46
|
-
it "
|
46
|
+
it "parses expired and return default (nil)" do
|
47
47
|
expect(@feed.expired).to be nil
|
48
48
|
end
|
49
49
|
|
50
|
-
it "
|
50
|
+
it "parses entries" do
|
51
51
|
expect(@feed.entries.size).to eq 20
|
52
52
|
end
|
53
53
|
end
|
@@ -3,20 +3,20 @@
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
5
|
describe Feedjira::Parser::PodloveChapter do
|
6
|
-
before
|
6
|
+
before do
|
7
7
|
@item = Feedjira::Parser::ITunesRSS.parse(sample_podlove_feed).entries.first
|
8
8
|
@chapter = @item.chapters.first
|
9
9
|
end
|
10
10
|
|
11
|
-
it "
|
11
|
+
it "parses chapters" do
|
12
12
|
expect(@item.chapters.size).to eq 15
|
13
13
|
end
|
14
14
|
|
15
|
-
it "
|
15
|
+
it "sorts chapters by time" do
|
16
16
|
expect(@item.chapters.last.title).to eq "Abschied"
|
17
17
|
end
|
18
18
|
|
19
|
-
it "
|
19
|
+
it "parses the start time" do
|
20
20
|
expect(@chapter.start_ntp).to eq "00:00:26.407"
|
21
21
|
expect(@chapter.start).to eq 26.407
|
22
22
|
expect(@item.chapters[1].start).to eq 50
|
@@ -25,15 +25,15 @@ describe Feedjira::Parser::PodloveChapter do
|
|
25
25
|
expect(@item.chapters.last.start).to eq 5700.034
|
26
26
|
end
|
27
27
|
|
28
|
-
it "
|
28
|
+
it "parses the title" do
|
29
29
|
expect(@chapter.title).to eq "Neil DeGrasse Tyson on Science"
|
30
30
|
end
|
31
31
|
|
32
|
-
it "
|
32
|
+
it "parses the link" do
|
33
33
|
expect(@chapter.url).to eq "https://example.com"
|
34
34
|
end
|
35
35
|
|
36
|
-
it "
|
36
|
+
it "parses the image" do
|
37
37
|
expect(@chapter.image).to eq "https://pics.example.com/pic.png"
|
38
38
|
end
|
39
39
|
end
|