feedjira 2.2.0 → 3.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +635 -6
  3. data/.travis.yml +1 -1
  4. data/CHANGELOG.md +6 -12
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +5 -5
  7. data/README.md +37 -99
  8. data/Rakefile +5 -5
  9. data/feedjira.gemspec +27 -19
  10. data/lib/feedjira.rb +69 -41
  11. data/lib/feedjira/configuration.rb +3 -8
  12. data/lib/feedjira/core_ext.rb +3 -3
  13. data/lib/feedjira/core_ext/date.rb +1 -1
  14. data/lib/feedjira/core_ext/time.rb +2 -2
  15. data/lib/feedjira/date_time_utilities.rb +2 -2
  16. data/lib/feedjira/date_time_utilities/date_time_pattern_parser.rb +2 -2
  17. data/lib/feedjira/feed.rb +10 -80
  18. data/lib/feedjira/feed_entry_utilities.rb +4 -4
  19. data/lib/feedjira/parser.rb +4 -1
  20. data/lib/feedjira/parser/atom.rb +3 -3
  21. data/lib/feedjira/parser/atom_entry.rb +1 -1
  22. data/lib/feedjira/parser/atom_feed_burner.rb +4 -4
  23. data/lib/feedjira/parser/atom_feed_burner_entry.rb +1 -1
  24. data/lib/feedjira/parser/atom_youtube.rb +2 -2
  25. data/lib/feedjira/parser/atom_youtube_entry.rb +1 -1
  26. data/lib/feedjira/parser/google_docs_atom.rb +3 -3
  27. data/lib/feedjira/parser/google_docs_atom_entry.rb +1 -1
  28. data/lib/feedjira/parser/itunes_rss_item.rb +1 -1
  29. data/lib/feedjira/parser/json_feed.rb +39 -0
  30. data/lib/feedjira/parser/json_feed_item.rb +51 -0
  31. data/lib/feedjira/parser/podlove_chapter.rb +1 -1
  32. data/lib/feedjira/parser/rss.rb +1 -1
  33. data/lib/feedjira/parser/rss_entry.rb +5 -1
  34. data/lib/feedjira/parser/rss_feed_burner.rb +1 -1
  35. data/lib/feedjira/preprocessor.rb +1 -1
  36. data/lib/feedjira/version.rb +1 -1
  37. data/spec/feedjira/configuration_spec.rb +9 -16
  38. data/spec/feedjira/date_time_utilities_spec.rb +20 -20
  39. data/spec/feedjira/feed_entry_utilities_spec.rb +18 -18
  40. data/spec/feedjira/feed_spec.rb +15 -229
  41. data/spec/feedjira/feed_utilities_spec.rb +72 -72
  42. data/spec/feedjira/parser/atom_entry_spec.rb +34 -34
  43. data/spec/feedjira/parser/atom_feed_burner_entry_spec.rb +16 -16
  44. data/spec/feedjira/parser/atom_feed_burner_spec.rb +121 -119
  45. data/spec/feedjira/parser/atom_spec.rb +78 -76
  46. data/spec/feedjira/parser/atom_youtube_entry_spec.rb +38 -38
  47. data/spec/feedjira/parser/atom_youtube_spec.rb +15 -15
  48. data/spec/feedjira/parser/google_docs_atom_entry_spec.rb +8 -8
  49. data/spec/feedjira/parser/google_docs_atom_spec.rb +23 -21
  50. data/spec/feedjira/parser/itunes_rss_item_spec.rb +37 -37
  51. data/spec/feedjira/parser/itunes_rss_owner_spec.rb +5 -5
  52. data/spec/feedjira/parser/itunes_rss_spec.rb +118 -116
  53. data/spec/feedjira/parser/json_feed_item_spec.rb +79 -0
  54. data/spec/feedjira/parser/json_feed_spec.rb +53 -0
  55. data/spec/feedjira/parser/podlove_chapter_spec.rb +12 -12
  56. data/spec/feedjira/parser/rss_entry_spec.rb +30 -30
  57. data/spec/feedjira/parser/rss_feed_burner_entry_spec.rb +32 -32
  58. data/spec/feedjira/parser/rss_feed_burner_spec.rb +47 -45
  59. data/spec/feedjira/parser/rss_spec.rb +36 -36
  60. data/spec/feedjira/preprocessor_spec.rb +6 -6
  61. data/spec/feedjira_spec.rb +145 -0
  62. data/spec/sample_feeds.rb +27 -26
  63. data/spec/sample_feeds/HuffPostCanada.xml +279 -0
  64. data/spec/sample_feeds/json_feed.json +156 -0
  65. data/spec/spec_helper.rb +5 -5
  66. metadata +31 -49
  67. data/fixtures/vcr_cassettes/fetch_failure.yml +0 -62
  68. data/fixtures/vcr_cassettes/parse_error.yml +0 -222
  69. data/fixtures/vcr_cassettes/success.yml +0 -281
  70. data/spec/sample_feeds/InvalidDateFormat.xml +0 -20
@@ -1,4 +1,4 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  describe Feedjira::Parser::AtomFeedBurnerEntry do
4
4
  before(:each) do
@@ -10,45 +10,45 @@ describe Feedjira::Parser::AtomFeedBurnerEntry do
10
10
  @entry = feed.entries.first
11
11
  end
12
12
 
13
- it 'should parse the title' do
14
- expect(@entry.title).to eq 'Making a Ruby C library even faster'
13
+ it "should parse the title" do
14
+ expect(@entry.title).to eq "Making a Ruby C library even faster"
15
15
  end
16
16
 
17
17
  it "should be able to fetch a url via the 'alternate' rel if no origLink exists" do # rubocop:disable Metrics/LineLength
18
18
  xml = File.read("#{File.dirname(__FILE__)}/../../sample_feeds/PaulDixExplainsNothingAlternate.xml") # rubocop:disable Metrics/LineLength
19
19
  entry = Feedjira::Parser::AtomFeedBurner.parse(xml).entries.first
20
- expect(entry.url).to eq 'http://feeds.feedburner.com/~r/PaulDixExplainsNothing/~3/519925023/making-a-ruby-c-library-even-faster.html'
20
+ expect(entry.url).to eq("http://feeds.feedburner.com/~r/PaulDixExplainsNothing/~3/519925023/making-a-ruby-c-library-even-faster.html") # rubocop:disable Metrics/LineLength
21
21
  end
22
22
 
23
- it 'should parse the url' do
24
- expect(@entry.url).to eq 'http://www.pauldix.net/2009/01/making-a-ruby-c-library-even-faster.html'
23
+ it "should parse the url" do
24
+ expect(@entry.url).to eq "http://www.pauldix.net/2009/01/making-a-ruby-c-library-even-faster.html"
25
25
  end
26
26
 
27
- it 'should parse the url when there is no alternate' do
27
+ it "should parse the url when there is no alternate" do
28
28
  xml = File.read("#{File.dirname(__FILE__)}/../../sample_feeds/FeedBurnerUrlNoAlternate.xml") # rubocop:disable Metrics/LineLength
29
29
  entry = Feedjira::Parser::AtomFeedBurner.parse(xml).entries.first
30
- expect(entry.url).to eq 'http://example.com/QQQQ.html'
30
+ expect(entry.url).to eq "http://example.com/QQQQ.html"
31
31
  end
32
32
 
33
- it 'should parse the author' do
34
- expect(@entry.author).to eq 'Paul Dix'
33
+ it "should parse the author" do
34
+ expect(@entry.author).to eq "Paul Dix"
35
35
  end
36
36
 
37
- it 'should parse the content' do
37
+ it "should parse the content" do
38
38
  expect(@entry.content).to eq sample_feedburner_atom_entry_content
39
39
  end
40
40
 
41
- it 'should provide a summary' do
41
+ it "should provide a summary" do
42
42
  summary = "Last week I released the first version of a SAX based XML parsing library called SAX-Machine. It uses Nokogiri, which uses libxml, so it's pretty fast. However, I felt that it could be even faster. The only question was how..." # rubocop:disable Metrics/LineLength
43
43
  expect(@entry.summary).to eq summary
44
44
  end
45
45
 
46
- it 'should parse the published date' do
47
- published = Time.parse_safely 'Thu Jan 22 15:50:22 UTC 2009'
46
+ it "should parse the published date" do
47
+ published = Time.parse_safely "Thu Jan 22 15:50:22 UTC 2009"
48
48
  expect(@entry.published).to eq published
49
49
  end
50
50
 
51
- it 'should parse the categories' do
52
- expect(@entry.categories).to eq ['Ruby', 'Another Category']
51
+ it "should parse the categories" do
52
+ expect(@entry.categories).to eq ["Ruby", "Another Category"]
53
53
  end
54
54
  end
@@ -1,124 +1,126 @@
1
- require 'spec_helper'
2
-
3
- module Feedjira::Parser
4
- describe '#will_parse?' do
5
- it 'should return true for a feedburner atom feed' do
6
- expect(AtomFeedBurner).to be_able_to_parse(sample_feedburner_atom_feed)
7
- end
8
-
9
- it 'should return false for an rdf feed' do
10
- expect(AtomFeedBurner).to_not be_able_to_parse(sample_rdf_feed)
11
- end
12
-
13
- it 'should return false for a regular atom feed' do
14
- expect(AtomFeedBurner).to_not be_able_to_parse(sample_atom_feed)
15
- end
16
-
17
- it 'should return false for an rss feedburner feed' do
18
- expect(AtomFeedBurner).to_not be_able_to_parse sample_rss_feed_burner_feed
19
- end
20
- end
21
-
22
- describe 'parsing old style feeds' do
23
- before(:each) do
24
- @feed = AtomFeedBurner.parse(sample_feedburner_atom_feed)
25
- end
26
-
27
- it 'should parse the title' do
28
- expect(@feed.title).to eq 'Paul Dix Explains Nothing'
29
- end
30
-
31
- it 'should parse the description' do
32
- description = 'Entrepreneurship, programming, software development, politics, NYC, and random thoughts.' # rubocop:disable Metrics/LineLength
33
- expect(@feed.description).to eq description
34
- end
35
-
36
- it 'should parse the url' do
37
- expect(@feed.url).to eq 'http://www.pauldix.net/'
38
- end
39
-
40
- it 'should parse the feed_url' do
41
- expect(@feed.feed_url).to eq 'http://feeds.feedburner.com/PaulDixExplainsNothing'
42
- end
43
-
44
- it 'should parse no hub urls' do
45
- expect(@feed.hubs.count).to eq 0
46
- end
47
-
48
- it 'should parse hub urls' do
49
- AtomFeedBurner.preprocess_xml = false
50
- feed_with_hub = AtomFeedBurner.parse(load_sample('TypePadNews.xml'))
51
- expect(feed_with_hub.hubs.count).to eq 1
52
- end
53
-
54
- it 'should parse entries' do
55
- expect(@feed.entries.size).to eq 5
56
- end
57
-
58
- it 'should change url' do
59
- new_url = 'http://some.url.com'
60
- expect { @feed.url = new_url }.not_to raise_error
61
- expect(@feed.url).to eq new_url
62
- end
63
-
64
- it 'should change feed_url' do
65
- new_url = 'http://some.url.com'
66
- expect { @feed.feed_url = new_url }.not_to raise_error
67
- expect(@feed.feed_url).to eq new_url
1
+ require "spec_helper"
2
+
3
+ module Feedjira
4
+ module Parser
5
+ describe "#will_parse?" do
6
+ it "should return true for a feedburner atom feed" do
7
+ expect(AtomFeedBurner).to be_able_to_parse(sample_feedburner_atom_feed)
8
+ end
9
+
10
+ it "should return false for an rdf feed" do
11
+ expect(AtomFeedBurner).to_not be_able_to_parse(sample_rdf_feed)
12
+ end
13
+
14
+ it "should return false for a regular atom feed" do
15
+ expect(AtomFeedBurner).to_not be_able_to_parse(sample_atom_feed)
16
+ end
17
+
18
+ it "should return false for an rss feedburner feed" do
19
+ expect(AtomFeedBurner).to_not be_able_to_parse sample_rss_feed_burner_feed
20
+ end
21
+ end
22
+
23
+ describe "parsing old style feeds" do
24
+ before(:each) do
25
+ @feed = AtomFeedBurner.parse(sample_feedburner_atom_feed)
26
+ end
27
+
28
+ it "should parse the title" do
29
+ expect(@feed.title).to eq "Paul Dix Explains Nothing"
30
+ end
31
+
32
+ it "should parse the description" do
33
+ description = "Entrepreneurship, programming, software development, politics, NYC, and random thoughts." # rubocop:disable Metrics/LineLength
34
+ expect(@feed.description).to eq description
35
+ end
36
+
37
+ it "should parse the url" do
38
+ expect(@feed.url).to eq "http://www.pauldix.net/"
39
+ end
40
+
41
+ it "should parse the feed_url" do
42
+ expect(@feed.feed_url).to eq "http://feeds.feedburner.com/PaulDixExplainsNothing"
43
+ end
44
+
45
+ it "should parse no hub urls" do
46
+ expect(@feed.hubs.count).to eq 0
47
+ end
48
+
49
+ it "should parse hub urls" do
50
+ AtomFeedBurner.preprocess_xml = false
51
+ feed_with_hub = AtomFeedBurner.parse(load_sample("TypePadNews.xml"))
52
+ expect(feed_with_hub.hubs.count).to eq 1
53
+ end
54
+
55
+ it "should parse entries" do
56
+ expect(@feed.entries.size).to eq 5
57
+ end
58
+
59
+ it "should change url" do
60
+ new_url = "http://some.url.com"
61
+ expect { @feed.url = new_url }.not_to raise_error
62
+ expect(@feed.url).to eq new_url
63
+ end
64
+
65
+ it "should change feed_url" do
66
+ new_url = "http://some.url.com"
67
+ expect { @feed.feed_url = new_url }.not_to raise_error
68
+ expect(@feed.feed_url).to eq new_url
69
+ end
70
+ end
71
+
72
+ describe "parsing alternate style feeds" do
73
+ before(:each) do
74
+ @feed = AtomFeedBurner.parse(sample_feedburner_atom_feed_alternate)
75
+ end
76
+
77
+ it "should parse the title" do
78
+ expect(@feed.title).to eq "Giant Robots Smashing Into Other Giant Robots"
79
+ end
80
+
81
+ it "should parse the description" do
82
+ description = "Written by thoughtbot"
83
+ expect(@feed.description).to eq description
84
+ end
85
+
86
+ it "should parse the url" do
87
+ expect(@feed.url).to eq "https://robots.thoughtbot.com"
88
+ end
89
+
90
+ it "should parse the feed_url" do
91
+ expect(@feed.feed_url).to eq "http://feeds.feedburner.com/GiantRobotsSmashingIntoOtherGiantRobots"
92
+ end
93
+
94
+ it "should parse hub urls" do
95
+ expect(@feed.hubs.count).to eq 1
96
+ end
97
+
98
+ it "should parse entries" do
99
+ expect(@feed.entries.size).to eq 3
100
+ end
101
+
102
+ it "should change url" do
103
+ new_url = "http://some.url.com"
104
+ expect { @feed.url = new_url }.not_to raise_error
105
+ expect(@feed.url).to eq new_url
106
+ end
107
+
108
+ it "should change feed_url" do
109
+ new_url = "http://some.url.com"
110
+ expect { @feed.feed_url = new_url }.not_to raise_error
111
+ expect(@feed.feed_url).to eq new_url
112
+ end
68
113
  end
69
- end
70
-
71
- describe 'parsing alternate style feeds' do
72
- before(:each) do
73
- @feed = AtomFeedBurner.parse(sample_feedburner_atom_feed_alternate)
74
- end
75
-
76
- it 'should parse the title' do
77
- expect(@feed.title).to eq 'Giant Robots Smashing Into Other Giant Robots'
78
- end
79
-
80
- it 'should parse the description' do
81
- description = 'Written by thoughtbot'
82
- expect(@feed.description).to eq description
83
- end
84
-
85
- it 'should parse the url' do
86
- expect(@feed.url).to eq 'https://robots.thoughtbot.com'
87
- end
88
-
89
- it 'should parse the feed_url' do
90
- expect(@feed.feed_url).to eq 'http://feeds.feedburner.com/GiantRobotsSmashingIntoOtherGiantRobots'
91
- end
92
-
93
- it 'should parse hub urls' do
94
- expect(@feed.hubs.count).to eq 1
95
- end
96
-
97
- it 'should parse entries' do
98
- expect(@feed.entries.size).to eq 3
99
- end
100
-
101
- it 'should change url' do
102
- new_url = 'http://some.url.com'
103
- expect { @feed.url = new_url }.not_to raise_error
104
- expect(@feed.url).to eq new_url
105
- end
106
-
107
- it 'should change feed_url' do
108
- new_url = 'http://some.url.com'
109
- expect { @feed.feed_url = new_url }.not_to raise_error
110
- expect(@feed.feed_url).to eq new_url
111
- end
112
- end
113
-
114
- describe 'preprocessing' do
115
- it 'retains markup in xhtml content' do
116
- AtomFeedBurner.preprocess_xml = true
117
-
118
- feed = AtomFeedBurner.parse sample_feed_burner_atom_xhtml_feed
119
- entry = feed.entries.first
120
114
 
121
- expect(entry.content).to match(/\A\<p/)
115
+ describe "preprocessing" do
116
+ it "retains markup in xhtml content" do
117
+ AtomFeedBurner.preprocess_xml = true
118
+
119
+ feed = AtomFeedBurner.parse sample_feed_burner_atom_xhtml_feed
120
+ entry = feed.entries.first
121
+
122
+ expect(entry.content).to match(/\A\<p/)
123
+ end
122
124
  end
123
125
  end
124
126
  end
@@ -1,104 +1,106 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
- module Feedjira::Parser
4
- describe '#will_parse?' do
5
- it 'should return true for an atom feed' do
6
- expect(Atom).to be_able_to_parse(sample_atom_feed)
7
- end
3
+ module Feedjira
4
+ module Parser
5
+ describe "#will_parse?" do
6
+ it "should return true for an atom feed" do
7
+ expect(Atom).to be_able_to_parse(sample_atom_feed)
8
+ end
8
9
 
9
- it 'should return false for an rdf feed' do
10
- expect(Atom).to_not be_able_to_parse(sample_rdf_feed)
11
- end
10
+ it "should return false for an rdf feed" do
11
+ expect(Atom).to_not be_able_to_parse(sample_rdf_feed)
12
+ end
12
13
 
13
- it 'should return false for an rss feedburner feed' do
14
- expect(Atom).to_not be_able_to_parse(sample_rss_feed_burner_feed)
15
- end
14
+ it "should return false for an rss feedburner feed" do
15
+ expect(Atom).to_not be_able_to_parse(sample_rss_feed_burner_feed)
16
+ end
16
17
 
17
- it 'should return true for an atom feed that has line breaks in between attributes in the <feed> node' do # rubocop:disable Metrics/LineLength
18
- expect(Atom).to be_able_to_parse(sample_atom_feed_line_breaks)
18
+ it "should return true for an atom feed that has line breaks in between attributes in the <feed> node" do # rubocop:disable Metrics/LineLength
19
+ expect(Atom).to be_able_to_parse(sample_atom_feed_line_breaks)
20
+ end
19
21
  end
20
- end
21
22
 
22
- describe 'parsing' do
23
- before(:each) do
24
- @feed = Atom.parse(sample_atom_feed)
25
- end
23
+ describe "parsing" do
24
+ before(:each) do
25
+ @feed = Atom.parse(sample_atom_feed)
26
+ end
26
27
 
27
- it 'should parse the title' do
28
- expect(@feed.title).to eq 'Amazon Web Services Blog'
29
- end
28
+ it "should parse the title" do
29
+ expect(@feed.title).to eq "Amazon Web Services Blog"
30
+ end
30
31
 
31
- it 'should parse the description' do
32
- description = 'Amazon Web Services, Products, Tools, and Developer Information...' # rubocop:disable Metrics/LineLength
33
- expect(@feed.description).to eq description
34
- end
32
+ it "should parse the description" do
33
+ description = "Amazon Web Services, Products, Tools, and Developer Information..." # rubocop:disable Metrics/LineLength
34
+ expect(@feed.description).to eq description
35
+ end
35
36
 
36
- it 'should parse the url' do
37
- expect(@feed.url).to eq 'http://aws.typepad.com/aws/'
38
- end
37
+ it "should parse the url" do
38
+ expect(@feed.url).to eq "http://aws.typepad.com/aws/"
39
+ end
39
40
 
40
- it "should parse the url even when it doesn't have the type='text/html' attribute" do # rubocop:disable Metrics/LineLength
41
- xml = load_sample 'atom_with_link_tag_for_url_unmarked.xml'
42
- feed = Atom.parse xml
43
- expect(feed.url).to eq 'http://www.innoq.com/planet/'
44
- end
41
+ it "should parse the url even when it doesn't have the type='text/html' attribute" do # rubocop:disable Metrics/LineLength
42
+ xml = load_sample "atom_with_link_tag_for_url_unmarked.xml"
43
+ feed = Atom.parse xml
44
+ expect(feed.url).to eq "http://www.innoq.com/planet/"
45
+ end
45
46
 
46
- it "should parse the feed_url even when it doesn't have the type='application/atom+xml' attribute" do # rubocop:disable Metrics/LineLength
47
- feed = Atom.parse(load_sample('atom_with_link_tag_for_url_unmarked.xml'))
48
- expect(feed.feed_url).to eq 'http://www.innoq.com/planet/atom.xml'
49
- end
47
+ it "should parse the feed_url even when it doesn't have the type='application/atom+xml' attribute" do # rubocop:disable Metrics/LineLength
48
+ feed = Atom.parse(load_sample("atom_with_link_tag_for_url_unmarked.xml"))
49
+ expect(feed.feed_url).to eq "http://www.innoq.com/planet/atom.xml"
50
+ end
50
51
 
51
- it 'should parse the feed_url' do
52
- expect(@feed.feed_url).to eq 'http://aws.typepad.com/aws/atom.xml'
53
- end
52
+ it "should parse the feed_url" do
53
+ expect(@feed.feed_url).to eq "http://aws.typepad.com/aws/atom.xml"
54
+ end
54
55
 
55
- it 'should parse no hub urls' do
56
- expect(@feed.hubs.count).to eq 0
57
- end
56
+ it "should parse no hub urls" do
57
+ expect(@feed.hubs.count).to eq 0
58
+ end
58
59
 
59
- it 'should parse the hub urls' do
60
- feed_with_hub = Atom.parse(load_sample('SamRuby.xml'))
61
- expect(feed_with_hub.hubs.count).to eq 1
62
- expect(feed_with_hub.hubs.first).to eq 'http://pubsubhubbub.appspot.com/'
63
- end
60
+ it "should parse the hub urls" do
61
+ feed_with_hub = Atom.parse(load_sample("SamRuby.xml"))
62
+ expect(feed_with_hub.hubs.count).to eq 1
63
+ expect(feed_with_hub.hubs.first).to eq "http://pubsubhubbub.appspot.com/"
64
+ end
64
65
 
65
- it 'should parse entries' do
66
- expect(@feed.entries.size).to eq 10
66
+ it "should parse entries" do
67
+ expect(@feed.entries.size).to eq 10
68
+ end
67
69
  end
68
- end
69
70
 
70
- describe 'preprocessing' do
71
- it 'retains markup in xhtml content' do
72
- Atom.preprocess_xml = true
71
+ describe "preprocessing" do
72
+ it "retains markup in xhtml content" do
73
+ Atom.preprocess_xml = true
73
74
 
74
- feed = Atom.parse sample_atom_xhtml_feed
75
- entry = feed.entries.first
75
+ feed = Atom.parse sample_atom_xhtml_feed
76
+ entry = feed.entries.first
76
77
 
77
- expect(entry.title).to match(/\<i/)
78
- expect(entry.summary).to match(/\<b/)
79
- expect(entry.content).to match(/\A\<p/)
80
- end
78
+ expect(entry.title).to match(/\<i/)
79
+ expect(entry.summary).to match(/\<b/)
80
+ expect(entry.content).to match(/\A\<p/)
81
+ end
81
82
 
82
- it 'should not duplicate content when there are divs in content' do
83
- Atom.preprocess_xml = true
83
+ it "should not duplicate content when there are divs in content" do
84
+ Atom.preprocess_xml = true
84
85
 
85
- feed = Atom.parse sample_duplicate_content_atom_feed
86
- content = Nokogiri::HTML(feed.entries[1].content)
87
- expect(content.css('img').length).to eq 11
86
+ feed = Atom.parse sample_duplicate_content_atom_feed
87
+ content = Nokogiri::HTML(feed.entries[1].content)
88
+ expect(content.css("img").length).to eq 11
89
+ end
88
90
  end
89
- end
90
91
 
91
- describe 'parsing url and feed url based on rel attribute' do
92
- before :each do
93
- @feed = Atom.parse(sample_atom_middleman_feed)
94
- end
92
+ describe "parsing url and feed url based on rel attribute" do
93
+ before :each do
94
+ @feed = Atom.parse(sample_atom_middleman_feed)
95
+ end
95
96
 
96
- it 'should parse url' do
97
- expect(@feed.url).to eq 'http://feedjira.com/blog'
98
- end
97
+ it "should parse url" do
98
+ expect(@feed.url).to eq "http://feedjira.com/blog"
99
+ end
99
100
 
100
- it 'should parse feed url' do
101
- expect(@feed.feed_url).to eq 'http://feedjira.com/blog/feed.xml'
101
+ it "should parse feed url" do
102
+ expect(@feed.feed_url).to eq "http://feedjira.com/blog/feed.xml"
103
+ end
102
104
  end
103
105
  end
104
106
  end