reagent-feedzirra 0.0.18

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.
@@ -0,0 +1,41 @@
1
+ require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
2
+
3
+ describe Feedzirra::Parser::RSSEntry do
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 AtomEnry
7
+ @entry = Feedzirra::Parser::RSS.parse(sample_rss_feed).entries.first
8
+ end
9
+
10
+ it "should parse the title" do
11
+ @entry.title.should == "Nokogiri’s Slop Feature"
12
+ end
13
+
14
+ it "should parse the url" do
15
+ @entry.url.should == "http://tenderlovemaking.com/2008/12/04/nokogiris-slop-feature/"
16
+ end
17
+
18
+ it "should parse the author" do
19
+ @entry.author.should == "Aaron Patterson"
20
+ end
21
+
22
+ it "should parse the content" do
23
+ @entry.content.should == sample_rss_entry_content
24
+ end
25
+
26
+ it "should provide a summary" do
27
+ @entry.summary.should == "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  [...]"
28
+ end
29
+
30
+ it "should parse the published date" do
31
+ @entry.published.to_s.should == "Thu Dec 04 17:17:49 UTC 2008"
32
+ end
33
+
34
+ it "should parse the categories" do
35
+ @entry.categories.should == ['computadora', 'nokogiri', 'rails']
36
+ end
37
+
38
+ it "should parse the guid as id" do
39
+ @entry.id.should == "http://tenderlovemaking.com/?p=198"
40
+ end
41
+ end
@@ -0,0 +1,45 @@
1
+ require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
2
+
3
+ describe Feedzirra::Parser::RSS do
4
+ describe "#will_parse?" do
5
+ it "should return true for an RSS feed" do
6
+ Feedzirra::Parser::RSS.should be_able_to_parse(sample_rss_feed)
7
+ end
8
+
9
+ # this is no longer true. combined rdf and rss into one
10
+ # it "should return false for an rdf feed" do
11
+ # Feedzirra::RSS.should_not be_able_to_parse(sample_rdf_feed)
12
+ # end
13
+
14
+ it "should return fase for an atom feed" do
15
+ Feedzirra::Parser::RSS.should_not be_able_to_parse(sample_atom_feed)
16
+ end
17
+ end
18
+
19
+ describe "parsing" do
20
+ before(:each) do
21
+ @feed = Feedzirra::Parser::RSS.parse(sample_rss_feed)
22
+ end
23
+
24
+ it "should parse the title" do
25
+ @feed.title.should == "Tender Lovemaking"
26
+ end
27
+
28
+ it "should parse the url" do
29
+ @feed.url.should == "http://tenderlovemaking.com"
30
+ end
31
+
32
+ it "should parse the description" do
33
+ @feed.description.should == 'The act of making love, tenderly.'
34
+ end
35
+
36
+ it "should provide an accessor for the feed_url" do
37
+ @feed.respond_to?(:feed_url).should == true
38
+ @feed.respond_to?(:feed_url=).should == true
39
+ end
40
+
41
+ it "should parse entries" do
42
+ @feed.entries.size.should == 10
43
+ end
44
+ end
45
+ end
data/spec/spec.opts ADDED
@@ -0,0 +1,2 @@
1
+ --diff
2
+ --color
@@ -0,0 +1,58 @@
1
+ require "rubygems"
2
+ require "spec"
3
+
4
+ # gem install redgreen for colored test output
5
+ begin require "redgreen" unless ENV['TM_CURRENT_LINE']; rescue LoadError; end
6
+
7
+ path = File.expand_path(File.dirname(__FILE__) + "/../lib/")
8
+ $LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
9
+
10
+ require "lib/feedzirra"
11
+
12
+ def load_sample(filename)
13
+ File.read("#{File.dirname(__FILE__)}/sample_feeds/#{filename}")
14
+ end
15
+
16
+ def sample_atom_feed
17
+ load_sample("AmazonWebServicesBlog.xml")
18
+ end
19
+
20
+ def sample_atom_entry_content
21
+ load_sample("AmazonWebServicesBlogFirstEntryContent.xml")
22
+ end
23
+
24
+ def sample_itunes_feed
25
+ load_sample("itunes.xml")
26
+ end
27
+
28
+ def sample_rdf_feed
29
+ load_sample("HREFConsideredHarmful.xml")
30
+ end
31
+
32
+ def sample_rdf_entry_content
33
+ load_sample("HREFConsideredHarmfulFirstEntry.xml")
34
+ end
35
+
36
+ def sample_rss_feed_burner_feed
37
+ load_sample("SamHarrisAuthorPhilosopherEssayistAtheist.xml")
38
+ end
39
+
40
+ def sample_rss_feed
41
+ load_sample("TenderLovemaking.xml")
42
+ end
43
+
44
+ def sample_rss_entry_content
45
+ load_sample("TenderLovemakingFirstEntry.xml")
46
+ end
47
+
48
+ def sample_feedburner_atom_feed
49
+ load_sample("PaulDixExplainsNothing.xml")
50
+ end
51
+
52
+ def sample_feedburner_atom_entry_content
53
+ load_sample("PaulDixExplainsNothingFirstEntryContent.xml")
54
+ end
55
+
56
+ def sample_wfw_feed
57
+ load_sample("PaulDixExplainsNothingWFW.xml")
58
+ end
metadata ADDED
@@ -0,0 +1,142 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: reagent-feedzirra
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.18
5
+ platform: ruby
6
+ authors:
7
+ - Paul Dix
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-02-19 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: nokogiri
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: pauldix-sax-machine
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.0.12
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: taf2-curb
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 0.2.3
44
+ version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: builder
47
+ type: :runtime
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 2.1.2
54
+ version:
55
+ - !ruby/object:Gem::Dependency
56
+ name: activesupport
57
+ type: :runtime
58
+ version_requirement:
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 2.0.0
64
+ version:
65
+ - !ruby/object:Gem::Dependency
66
+ name: mdalessio-dryopteris
67
+ type: :runtime
68
+ version_requirement:
69
+ version_requirements: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: 0.0.0
74
+ version:
75
+ description:
76
+ email: paul@pauldix.net
77
+ executables: []
78
+
79
+ extensions: []
80
+
81
+ extra_rdoc_files: []
82
+
83
+ files:
84
+ - lib/core_ext/date.rb
85
+ - lib/core_ext/string.rb
86
+ - lib/feedzirra.rb
87
+ - lib/feedzirra/feed.rb
88
+ - lib/feedzirra/parser/atom.rb
89
+ - lib/feedzirra/parser/atom_entry.rb
90
+ - lib/feedzirra/parser/atom_feed_burner.rb
91
+ - lib/feedzirra/parser/atom_feed_burner_entry.rb
92
+ - lib/feedzirra/parser/itunes_rss.rb
93
+ - lib/feedzirra/parser/itunes_rss_item.rb
94
+ - lib/feedzirra/parser/itunes_rss_owner.rb
95
+ - lib/feedzirra/parser/rss.rb
96
+ - lib/feedzirra/parser/rss_entry.rb
97
+ - lib/feedzirra/feed_utilities.rb
98
+ - lib/feedzirra/feed_entry_utilities.rb
99
+ - README.textile
100
+ - Rakefile
101
+ - spec/spec.opts
102
+ - spec/spec_helper.rb
103
+ - spec/feedzirra/feed_spec.rb
104
+ - spec/feedzirra/parser/atom_spec.rb
105
+ - spec/feedzirra/parser/atom_entry_spec.rb
106
+ - spec/feedzirra/parser/atom_feed_burner_spec.rb
107
+ - spec/feedzirra/parser/atom_feed_burner_entry_spec.rb
108
+ - spec/feedzirra/parser/itunes_rss_spec.rb
109
+ - spec/feedzirra/parser/itunes_rss_item_spec.rb
110
+ - spec/feedzirra/parser/itunes_rss_owner_spec.rb
111
+ - spec/feedzirra/parser/rss_spec.rb
112
+ - spec/feedzirra/parser/rss_entry_spec.rb
113
+ - spec/feedzirra/feed_utilities_spec.rb
114
+ - spec/feedzirra/feed_entry_utilities_spec.rb
115
+ has_rdoc: true
116
+ homepage: http://github.com/pauldix/feedzirra
117
+ post_install_message:
118
+ rdoc_options: []
119
+
120
+ require_paths:
121
+ - lib
122
+ required_ruby_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: "0"
127
+ version:
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: "0"
133
+ version:
134
+ requirements: []
135
+
136
+ rubyforge_project:
137
+ rubygems_version: 1.2.0
138
+ signing_key:
139
+ specification_version: 2
140
+ summary: "A feed fetching and parsing library that treats the internet like Godzilla treats Japan: it dominates and eats all."
141
+ test_files: []
142
+