feedjira 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -0
- data/CHANGELOG.md +14 -0
- data/Gemfile +1 -0
- data/feedjira.gemspec +4 -4
- data/lib/feedjira/feed_utilities.rb +2 -1
- data/lib/feedjira/version.rb +1 -1
- data/spec/feedjira/feed_entry_utilities_spec.rb +11 -11
- data/spec/feedjira/feed_spec.rb +165 -164
- data/spec/feedjira/feed_utilities_spec.rb +35 -35
- data/spec/feedjira/parser/atom_entry_spec.rb +22 -26
- data/spec/feedjira/parser/atom_feed_burner_entry_spec.rb +9 -9
- data/spec/feedjira/parser/atom_feed_burner_spec.rb +12 -12
- data/spec/feedjira/parser/atom_spec.rb +20 -18
- data/spec/feedjira/parser/google_docs_atom_entry_spec.rb +3 -3
- data/spec/feedjira/parser/google_docs_atom_spec.rb +5 -5
- data/spec/feedjira/parser/itunes_rss_item_spec.rb +15 -15
- data/spec/feedjira/parser/itunes_rss_owner_spec.rb +2 -2
- data/spec/feedjira/parser/itunes_rss_spec.rb +15 -15
- data/spec/feedjira/parser/rss_entry_spec.rb +18 -23
- data/spec/feedjira/parser/rss_feed_burner_entry_spec.rb +18 -23
- data/spec/feedjira/parser/rss_feed_burner_spec.rb +13 -13
- data/spec/feedjira/parser/rss_spec.rb +11 -11
- data/spec/feedjira/preprocessor_spec.rb +2 -2
- data/spec/sample_feeds/itunes.xml +0 -1
- data/spec/spec_helper.rb +2 -0
- metadata +11 -11
@@ -8,56 +8,56 @@ describe Feedjira::Parser::ITunesRSSItem do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should parse the title" do
|
11
|
-
@item.title.
|
11
|
+
expect(@item.title).to eq "Shake Shake Shake Your Spices"
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should parse the author" do
|
15
|
-
@item.itunes_author.
|
15
|
+
expect(@item.itunes_author).to eq "John Doe"
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should parse the subtitle" do
|
19
|
-
@item.itunes_subtitle.
|
19
|
+
expect(@item.itunes_subtitle).to eq "A short primer on table spices"
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should parse the summary" do
|
23
|
-
@item.itunes_summary.
|
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!"
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should parse the enclosure" do
|
27
|
-
@item.enclosure_length.
|
28
|
-
@item.enclosure_type.
|
29
|
-
@item.enclosure_url.
|
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"
|
30
30
|
end
|
31
31
|
|
32
32
|
it "should parse the guid as id" do
|
33
|
-
@item.id.
|
33
|
+
expect(@item.id).to eq "http://example.com/podcasts/archive/aae20050615.m4a"
|
34
34
|
end
|
35
35
|
|
36
36
|
it "should parse the published date" do
|
37
|
-
@item.published.
|
37
|
+
expect(@item.published).to eq Time.parse_safely("Wed Jun 15 19:00:00 UTC 2005")
|
38
38
|
end
|
39
39
|
|
40
40
|
it "should parse the duration" do
|
41
|
-
@item.itunes_duration.
|
41
|
+
expect(@item.itunes_duration).to eq "7:04"
|
42
42
|
end
|
43
43
|
|
44
44
|
it "should parse the keywords" do
|
45
|
-
@item.itunes_keywords.
|
45
|
+
expect(@item.itunes_keywords).to eq "salt, pepper, shaker, exciting"
|
46
46
|
end
|
47
47
|
|
48
48
|
it "should parse the image" do
|
49
|
-
@item.itunes_image.
|
49
|
+
expect(@item.itunes_image).to eq "http://example.com/podcasts/everything/AllAboutEverything.jpg"
|
50
50
|
end
|
51
51
|
|
52
52
|
it "should parse the order" do
|
53
|
-
@item.itunes_order.
|
53
|
+
expect(@item.itunes_order).to eq '12'
|
54
54
|
end
|
55
55
|
|
56
56
|
it "should parse the closed captioned flag" do
|
57
|
-
@item.itunes_closed_captioned.
|
57
|
+
expect(@item.itunes_closed_captioned).to eq 'yes'
|
58
58
|
end
|
59
59
|
|
60
60
|
it "should parse the encoded content" do
|
61
|
-
@item.content.
|
61
|
+
expect(@item.content).to eq "<p><strong>TOPIC</strong>: Gooseneck Options</p>"
|
62
62
|
end
|
63
63
|
end
|
@@ -8,11 +8,11 @@ describe Feedjira::Parser::ITunesRSSOwner do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should parse the name" do
|
11
|
-
@owner.name.
|
11
|
+
expect(@owner.name).to eq "John Doe"
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should parse the email" do
|
15
|
-
@owner.email.
|
15
|
+
expect(@owner.email).to eq "john.doe@example.com"
|
16
16
|
end
|
17
17
|
|
18
18
|
end
|
@@ -3,19 +3,19 @@ require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
|
|
3
3
|
describe Feedjira::Parser::ITunesRSS do
|
4
4
|
describe "#will_parse?" do
|
5
5
|
it "should return true for an itunes RSS feed" do
|
6
|
-
Feedjira::Parser::ITunesRSS.
|
6
|
+
expect(Feedjira::Parser::ITunesRSS).to be_able_to_parse(sample_itunes_feed)
|
7
7
|
end
|
8
8
|
|
9
9
|
it "should return true for an itunes RSS feed with spaces between attribute names, equals sign, and values" do
|
10
|
-
Feedjira::Parser::ITunesRSS.
|
10
|
+
expect(Feedjira::Parser::ITunesRSS).to be_able_to_parse(sample_itunes_feed_with_spaces)
|
11
11
|
end
|
12
12
|
|
13
13
|
it "should return fase for an atom feed" do
|
14
|
-
Feedjira::Parser::ITunesRSS.
|
14
|
+
expect(Feedjira::Parser::ITunesRSS).to_not be_able_to_parse(sample_atom_feed)
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should return false for an rss feedburner feed" do
|
18
|
-
Feedjira::Parser::ITunesRSS.
|
18
|
+
expect(Feedjira::Parser::ITunesRSS).to_not be_able_to_parse(sample_rss_feed_burner_feed)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -25,38 +25,38 @@ describe Feedjira::Parser::ITunesRSS do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
it "should parse the subtitle" do
|
28
|
-
@feed.itunes_subtitle.
|
28
|
+
expect(@feed.itunes_subtitle).to eq "A show about everything"
|
29
29
|
end
|
30
30
|
|
31
31
|
it "should parse the author" do
|
32
|
-
@feed.itunes_author.
|
32
|
+
expect(@feed.itunes_author).to eq "John Doe"
|
33
33
|
end
|
34
34
|
|
35
35
|
it "should parse an owner" do
|
36
|
-
@feed.itunes_owners.size.
|
36
|
+
expect(@feed.itunes_owners.size).to eq 1
|
37
37
|
end
|
38
38
|
|
39
39
|
it "should parse an image" do
|
40
|
-
@feed.itunes_image.
|
40
|
+
expect(@feed.itunes_image).to eq "http://example.com/podcasts/everything/AllAboutEverything.jpg"
|
41
41
|
end
|
42
42
|
|
43
43
|
it "should parse categories" do
|
44
|
-
@feed.itunes_categories.size
|
45
|
-
@feed.itunes_categories[0]
|
46
|
-
@feed.itunes_categories[1]
|
47
|
-
@feed.itunes_categories[2]
|
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"
|
48
48
|
end
|
49
49
|
|
50
50
|
it "should parse the summary" do
|
51
|
-
@feed.itunes_summary.
|
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"
|
52
52
|
end
|
53
53
|
|
54
54
|
it "should parse entries" do
|
55
|
-
@feed.entries.size.
|
55
|
+
expect(@feed.entries.size).to eq 3
|
56
56
|
end
|
57
57
|
|
58
58
|
it "should parse the new-feed-url" do
|
59
|
-
@feed.itunes_new_feed_url.
|
59
|
+
expect(@feed.itunes_new_feed_url).to eq "http://example.com/new.xml"
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
@@ -6,6 +6,7 @@ describe Feedjira::Parser::RSSEntry do
|
|
6
6
|
# I don't really like doing it this way because these unit test should only rely on RSSEntry,
|
7
7
|
# but this is actually how it should work. You would never just pass entry xml straight to the AtomEnry
|
8
8
|
@entry = Feedjira::Parser::RSS.parse(sample_rss_feed).entries.first
|
9
|
+
Feedjira::Feed.add_common_feed_entry_element("wfw:commentRss", :as => :comment_rss)
|
9
10
|
end
|
10
11
|
|
11
12
|
after(:each) do
|
@@ -16,70 +17,64 @@ describe Feedjira::Parser::RSSEntry do
|
|
16
17
|
end
|
17
18
|
|
18
19
|
it "should parse the title" do
|
19
|
-
@entry.title.
|
20
|
+
expect(@entry.title).to eq "Nokogiri’s Slop Feature"
|
20
21
|
end
|
21
22
|
|
22
23
|
it "should parse the url" do
|
23
|
-
@entry.url.
|
24
|
+
expect(@entry.url).to eq "http://tenderlovemaking.com/2008/12/04/nokogiris-slop-feature/"
|
24
25
|
end
|
25
26
|
|
26
27
|
it "should parse the author" do
|
27
|
-
@entry.author.
|
28
|
+
expect(@entry.author).to eq "Aaron Patterson"
|
28
29
|
end
|
29
30
|
|
30
31
|
it "should parse the content" do
|
31
|
-
@entry.content.
|
32
|
+
expect(@entry.content).to eq sample_rss_entry_content
|
32
33
|
end
|
33
34
|
|
34
35
|
it "should provide a summary" do
|
35
|
-
@entry.summary.
|
36
|
+
expect(@entry.summary).to eq "Oops! When I released nokogiri version 1.0.7, I totally forgot to talk about Nokogiri::Slop() feature that was added. Why is it called \"slop\"? It lets you sloppily explore documents. Basically, it decorates your document with method_missing() that allows you to search your document via method calls.\nGiven this document:\n\ndoc = Nokogiri::Slop(<<-eohtml)\n<html>\n  <body>\n  [...]"
|
36
37
|
end
|
37
38
|
|
38
39
|
it "should parse the published date" do
|
39
|
-
@entry.published.
|
40
|
+
expect(@entry.published).to eq Time.parse_safely("Thu Dec 04 17:17:49 UTC 2008")
|
40
41
|
end
|
41
42
|
|
42
43
|
it "should parse the categories" do
|
43
|
-
@entry.categories.
|
44
|
+
expect(@entry.categories).to eq ['computadora', 'nokogiri', 'rails']
|
44
45
|
end
|
45
46
|
|
46
47
|
it "should parse the guid as id" do
|
47
|
-
@entry.id.
|
48
|
+
expect(@entry.id).to eq "http://tenderlovemaking.com/?p=198"
|
48
49
|
end
|
49
50
|
|
50
51
|
it "should support each" do
|
51
|
-
@entry.respond_to
|
52
|
+
expect(@entry).to respond_to :each
|
52
53
|
end
|
53
54
|
|
54
55
|
it "should be able to list out all fields with each" do
|
55
56
|
all_fields = []
|
56
|
-
@entry.each do |field, value|
|
57
|
-
all_fields << field
|
58
|
-
end
|
59
|
-
all_fields.sort == ['author', 'categories', 'content', 'id', 'published', 'summary', 'title', 'url']
|
60
|
-
end
|
61
|
-
|
62
|
-
it "should be able to list out all values with each" do
|
63
57
|
title_value = ''
|
64
58
|
@entry.each do |field, value|
|
59
|
+
all_fields << field
|
65
60
|
title_value = value if field == 'title'
|
66
61
|
end
|
67
|
-
|
62
|
+
expect(all_fields.sort).to eq ["author", "categories", "comment_rss", "content", "entry_id", "published", "summary", "title", "url"]
|
63
|
+
expect(title_value).to eq "Nokogiri’s Slop Feature"
|
68
64
|
end
|
69
65
|
|
70
66
|
it "should support checking if a field exists in the entry" do
|
71
|
-
@entry.include
|
67
|
+
expect(@entry).to include 'title'
|
68
|
+
expect(@entry).to include 'author'
|
72
69
|
end
|
73
70
|
|
74
71
|
it "should allow access to fields with hash syntax" do
|
75
|
-
@entry['title']
|
76
|
-
@entry['
|
77
|
-
@entry['author'] == @entry.author
|
78
|
-
@entry['author'].should == "Aaron Patterson"
|
72
|
+
expect(@entry['title']).to eq "Nokogiri’s Slop Feature"
|
73
|
+
expect(@entry['author']).to eq "Aaron Patterson"
|
79
74
|
end
|
80
75
|
|
81
76
|
it "should allow setting field values with hash syntax" do
|
82
77
|
@entry['title'] = "Foobar"
|
83
|
-
@entry.title.
|
78
|
+
expect(@entry.title).to eq "Foobar"
|
84
79
|
end
|
85
80
|
end
|
@@ -6,6 +6,7 @@ describe Feedjira::Parser::RSSFeedBurnerEntry do
|
|
6
6
|
# I don't really like doing it this way because these unit test should only rely on RSSEntry,
|
7
7
|
# but this is actually how it should work. You would never just pass entry xml straight to the AtomEnry
|
8
8
|
@entry = Feedjira::Parser::RSSFeedBurner.parse(sample_rss_feed_burner_feed).entries.first
|
9
|
+
Feedjira::Feed.add_common_feed_entry_element("wfw:commentRss", :as => :comment_rss)
|
9
10
|
end
|
10
11
|
|
11
12
|
after(:each) do
|
@@ -16,70 +17,64 @@ describe Feedjira::Parser::RSSFeedBurnerEntry do
|
|
16
17
|
end
|
17
18
|
|
18
19
|
it "should parse the title" do
|
19
|
-
@entry.title.
|
20
|
+
expect(@entry.title).to eq "Angie’s List Sets Price Range IPO At $11 To $13 Per Share; Valued At Over $600M"
|
20
21
|
end
|
21
22
|
|
22
23
|
it "should parse the original url" do
|
23
|
-
@entry.url.
|
24
|
+
expect(@entry.url).to eq "http://techcrunch.com/2011/11/02/angies-list-prices-ipo-at-11-to-13-per-share-valued-at-over-600m/"
|
24
25
|
end
|
25
26
|
|
26
27
|
it "should parse the author" do
|
27
|
-
@entry.author.
|
28
|
+
expect(@entry.author).to eq "Leena Rao"
|
28
29
|
end
|
29
30
|
|
30
31
|
it "should parse the content" do
|
31
|
-
@entry.content.
|
32
|
+
expect(@entry.content).to eq sample_rss_feed_burner_entry_content
|
32
33
|
end
|
33
34
|
|
34
35
|
it "should provide a summary" do
|
35
|
-
@entry.summary.
|
36
|
+
expect(@entry.summary).to eq sample_rss_feed_burner_entry_description
|
36
37
|
end
|
37
38
|
|
38
39
|
it "should parse the published date" do
|
39
|
-
@entry.published.
|
40
|
+
expect(@entry.published).to eq Time.parse_safely("Wed Nov 02 17:25:27 UTC 2011")
|
40
41
|
end
|
41
42
|
|
42
43
|
it "should parse the categories" do
|
43
|
-
@entry.categories.
|
44
|
+
expect(@entry.categories).to eq ["TC", "angie\\'s list"]
|
44
45
|
end
|
45
46
|
|
46
47
|
it "should parse the guid as id" do
|
47
|
-
@entry.id.
|
48
|
+
expect(@entry.id).to eq "http://techcrunch.com/?p=446154"
|
48
49
|
end
|
49
50
|
|
50
51
|
it "should support each" do
|
51
|
-
@entry.respond_to
|
52
|
+
expect(@entry).to respond_to :each
|
52
53
|
end
|
53
54
|
|
54
55
|
it "should be able to list out all fields with each" do
|
55
56
|
all_fields = []
|
56
|
-
@entry.each do |field, value|
|
57
|
-
all_fields << field
|
58
|
-
end
|
59
|
-
all_fields.sort == ['author', 'categories', 'content', 'id', 'published', 'summary', 'title', 'url']
|
60
|
-
end
|
61
|
-
|
62
|
-
it "should be able to list out all values with each" do
|
63
57
|
title_value = ''
|
64
58
|
@entry.each do |field, value|
|
59
|
+
all_fields << field
|
65
60
|
title_value = value if field == 'title'
|
66
61
|
end
|
67
|
-
|
62
|
+
expect(all_fields.sort).to eq ["author", "categories", "comment_rss", "content", "entry_id", "image", "published", "summary", "title", "url"]
|
63
|
+
expect(title_value).to eq "Angie’s List Sets Price Range IPO At $11 To $13 Per Share; Valued At Over $600M"
|
68
64
|
end
|
69
65
|
|
70
66
|
it "should support checking if a field exists in the entry" do
|
71
|
-
@entry.include
|
67
|
+
expect(@entry).to include 'author'
|
68
|
+
expect(@entry).to include 'title'
|
72
69
|
end
|
73
70
|
|
74
71
|
it "should allow access to fields with hash syntax" do
|
75
|
-
@entry['
|
76
|
-
@entry['title'].
|
77
|
-
@entry['author'] == @entry.author
|
78
|
-
@entry['author'].should == "Leena Rao"
|
72
|
+
expect(@entry['author']).to eq "Leena Rao"
|
73
|
+
expect(@entry['title']).to eq "Angie’s List Sets Price Range IPO At $11 To $13 Per Share; Valued At Over $600M"
|
79
74
|
end
|
80
75
|
|
81
76
|
it "should allow setting field values with hash syntax" do
|
82
77
|
@entry['title'] = "Foobar"
|
83
|
-
@entry.title.
|
78
|
+
expect(@entry.title).to eq "Foobar"
|
84
79
|
end
|
85
80
|
end
|
@@ -3,23 +3,23 @@ require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
|
|
3
3
|
describe Feedjira::Parser::RSSFeedBurner do
|
4
4
|
describe "#will_parse?" do
|
5
5
|
it "should return true for a feedburner rss feed" do
|
6
|
-
Feedjira::Parser::RSSFeedBurner.
|
6
|
+
expect(Feedjira::Parser::RSSFeedBurner).to be_able_to_parse(sample_rss_feed_burner_feed)
|
7
7
|
end
|
8
8
|
|
9
9
|
it "should return false for a regular RSS feed" do
|
10
|
-
Feedjira::Parser::RSSFeedBurner.
|
10
|
+
expect(Feedjira::Parser::RSSFeedBurner).to_not be_able_to_parse(sample_rss_feed)
|
11
11
|
end
|
12
12
|
|
13
13
|
it "should return false for a feedburner atom feed" do
|
14
|
-
Feedjira::Parser::RSSFeedBurner.
|
14
|
+
expect(Feedjira::Parser::RSSFeedBurner).to_not be_able_to_parse(sample_feedburner_atom_feed)
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should return false for an rdf feed" do
|
18
|
-
Feedjira::Parser::RSSFeedBurner.
|
18
|
+
expect(Feedjira::Parser::RSSFeedBurner).to_not be_able_to_parse(sample_rdf_feed)
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should return false for a regular atom feed" do
|
22
|
-
Feedjira::Parser::RSSFeedBurner.
|
22
|
+
expect(Feedjira::Parser::RSSFeedBurner).to_not be_able_to_parse(sample_atom_feed)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -29,29 +29,29 @@ describe Feedjira::Parser::RSSFeedBurner do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
it "should parse the title" do
|
32
|
-
@feed.title.
|
32
|
+
expect(@feed.title).to eq "TechCrunch"
|
33
33
|
end
|
34
34
|
|
35
35
|
it "should parse the description" do
|
36
|
-
@feed.description.
|
36
|
+
expect(@feed.description).to eq "TechCrunch is a group-edited blog that profiles the companies, products and events defining and transforming the new web."
|
37
37
|
end
|
38
38
|
|
39
39
|
it "should parse the url" do
|
40
|
-
@feed.url.
|
40
|
+
expect(@feed.url).to eq "http://techcrunch.com"
|
41
41
|
end
|
42
42
|
|
43
43
|
it "should parse the hub urls" do
|
44
|
-
@feed.hubs.count.
|
45
|
-
@feed.hubs.first.
|
44
|
+
expect(@feed.hubs.count).to eq 2
|
45
|
+
expect(@feed.hubs.first).to eq "http://pubsubhubbub.appspot.com/"
|
46
46
|
end
|
47
47
|
|
48
48
|
it "should provide an accessor for the feed_url" do
|
49
|
-
@feed.respond_to
|
50
|
-
@feed.respond_to
|
49
|
+
expect(@feed).to respond_to :feed_url
|
50
|
+
expect(@feed).to respond_to :feed_url=
|
51
51
|
end
|
52
52
|
|
53
53
|
it "should parse entries" do
|
54
|
-
@feed.entries.size.
|
54
|
+
expect(@feed.entries.size).to eq 20
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
@@ -3,7 +3,7 @@ require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
|
|
3
3
|
describe Feedjira::Parser::RSS do
|
4
4
|
describe "#will_parse?" do
|
5
5
|
it "should return true for an RSS feed" do
|
6
|
-
Feedjira::Parser::RSS.
|
6
|
+
expect(Feedjira::Parser::RSS).to be_able_to_parse(sample_rss_feed)
|
7
7
|
end
|
8
8
|
|
9
9
|
# this is no longer true. combined rdf and rss into one
|
@@ -12,11 +12,11 @@ describe Feedjira::Parser::RSS do
|
|
12
12
|
# end
|
13
13
|
|
14
14
|
it "should return false for an atom feed" do
|
15
|
-
Feedjira::Parser::RSS.
|
15
|
+
expect(Feedjira::Parser::RSS).to_not be_able_to_parse(sample_atom_feed)
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should return false for an rss feedburner feed" do
|
19
|
-
Feedjira::Parser::RSS.
|
19
|
+
expect(Feedjira::Parser::RSS).to_not be_able_to_parse(sample_rss_feed_burner_feed)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -26,32 +26,32 @@ describe Feedjira::Parser::RSS do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
it "should parse the version" do
|
29
|
-
@feed.version.
|
29
|
+
expect(@feed.version).to eq "2.0"
|
30
30
|
end
|
31
31
|
|
32
32
|
it "should parse the title" do
|
33
|
-
@feed.title.
|
33
|
+
expect(@feed.title).to eq "Tender Lovemaking"
|
34
34
|
end
|
35
35
|
|
36
36
|
it "should parse the description" do
|
37
|
-
@feed.description.
|
37
|
+
expect(@feed.description).to eq "The act of making love, tenderly."
|
38
38
|
end
|
39
39
|
|
40
40
|
it "should parse the url" do
|
41
|
-
@feed.url.
|
41
|
+
expect(@feed.url).to eq "http://tenderlovemaking.com"
|
42
42
|
end
|
43
43
|
|
44
44
|
it "should not parse hub urls" do
|
45
|
-
@feed.hubs.
|
45
|
+
expect(@feed.hubs).to be_nil
|
46
46
|
end
|
47
47
|
|
48
48
|
it "should provide an accessor for the feed_url" do
|
49
|
-
@feed.respond_to
|
50
|
-
@feed.respond_to
|
49
|
+
expect(@feed).to respond_to :feed_url
|
50
|
+
expect(@feed).to respond_to :feed_url=
|
51
51
|
end
|
52
52
|
|
53
53
|
it "should parse entries" do
|
54
|
-
@feed.entries.size.
|
54
|
+
expect(@feed.entries.size).to eq 10
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
@@ -7,13 +7,13 @@ describe Feedjira::Preprocessor do
|
|
7
7
|
processor = Feedjira::Preprocessor.new xml
|
8
8
|
escaped = processor.to_xml
|
9
9
|
|
10
|
-
escaped.
|
10
|
+
expect(escaped).to eq doc.to_xml
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'escapes markup in xhtml content' do
|
14
14
|
processor = Feedjira::Preprocessor.new sample_atom_xhtml_feed
|
15
15
|
escaped = processor.to_xml
|
16
16
|
|
17
|
-
escaped.split("\n")[26].
|
17
|
+
expect(escaped.split("\n")[26]).to match /<p>$/
|
18
18
|
end
|
19
19
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: feedjira
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Dix
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-
|
14
|
+
date: 2014-09-05 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: sax-machine
|
@@ -19,56 +19,56 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - "~>"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0
|
22
|
+
version: '1.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0
|
29
|
+
version: '1.0'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: curb
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
34
|
- - "~>"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 0.8
|
36
|
+
version: '0.8'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
41
|
- - "~>"
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.8
|
43
|
+
version: '0.8'
|
44
44
|
- !ruby/object:Gem::Dependency
|
45
45
|
name: loofah
|
46
46
|
requirement: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
48
|
- - "~>"
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 2.0
|
50
|
+
version: '2.0'
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
55
|
- - "~>"
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: 2.0
|
57
|
+
version: '2.0'
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rspec
|
60
60
|
requirement: !ruby/object:Gem::Requirement
|
61
61
|
requirements:
|
62
62
|
- - "~>"
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version:
|
64
|
+
version: '3.0'
|
65
65
|
type: :development
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
69
|
- - "~>"
|
70
70
|
- !ruby/object:Gem::Version
|
71
|
-
version:
|
71
|
+
version: '3.0'
|
72
72
|
description: A library designed to retrieve and parse feeds as quickly as possible
|
73
73
|
email: feedjira@gmail.com
|
74
74
|
executables: []
|
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
version: '0'
|
174
174
|
requirements: []
|
175
175
|
rubyforge_project:
|
176
|
-
rubygems_version: 2.2.
|
176
|
+
rubygems_version: 2.2.2
|
177
177
|
signing_key:
|
178
178
|
specification_version: 4
|
179
179
|
summary: A feed fetching and parsing library
|