google_reader 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,8 +3,11 @@ require "time"
3
3
 
4
4
  module GoogleReader
5
5
  class Entry
6
- def initialize(entry)
6
+ attr_reader :feed
7
+
8
+ def initialize(entry, feed)
7
9
  @entry = entry
10
+ @feed = feed
8
11
  end
9
12
 
10
13
  def hash
@@ -9,7 +9,7 @@ module GoogleReader
9
9
  end
10
10
 
11
11
  def entries
12
- @entries ||= @feed.search("entry").map {|entry| Entry.new(entry)}
12
+ @entries ||= @feed.search("entry").map {|entry| Entry.new(entry, self)}
13
13
  end
14
14
 
15
15
  def id
@@ -1,3 +1,3 @@
1
1
  module GoogleReader
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
data/spec/entry_spec.rb CHANGED
@@ -17,8 +17,16 @@ describe GoogleReader::Entry, "where the author is known, and the updated timest
17
17
  expected << "09036194539349082984"
18
18
  end
19
19
 
20
+ let :feed do
21
+ Object.new
22
+ end
23
+
20
24
  subject do
21
- GoogleReader::Entry.new(entry)
25
+ GoogleReader::Entry.new(entry, feed)
26
+ end
27
+
28
+ it "should reference it's feed" do
29
+ subject.feed.should == feed
22
30
  end
23
31
 
24
32
  it "should be equal to itself" do
@@ -26,11 +34,11 @@ describe GoogleReader::Entry, "where the author is known, and the updated timest
26
34
  end
27
35
 
28
36
  it "should be equal to another entry instance with the same id" do
29
- subject.should == GoogleReader::Entry.new(entry)
37
+ subject.should == GoogleReader::Entry.new(entry, nil)
30
38
  end
31
39
 
32
40
  it "should have the same hash as another instance with the same id" do
33
- subject.hash.should == GoogleReader::Entry.new(entry).hash
41
+ subject.hash.should == GoogleReader::Entry.new(entry, nil).hash
34
42
  end
35
43
 
36
44
  it "should HTML unescape the title" do
@@ -88,7 +96,7 @@ describe GoogleReader::Entry, "where the author is unknown" do
88
96
  end
89
97
 
90
98
  subject do
91
- GoogleReader::Entry.new(entry)
99
+ GoogleReader::Entry.new(entry, nil)
92
100
  end
93
101
 
94
102
  it { subject.should_not have_known_author }
@@ -105,7 +113,7 @@ describe GoogleReader::Entry, "where no users have liked the entry" do
105
113
  end
106
114
 
107
115
  subject do
108
- GoogleReader::Entry.new(entry)
116
+ GoogleReader::Entry.new(entry, nil)
109
117
  end
110
118
 
111
119
  it { subject.liking_users.should be_empty }
@@ -121,7 +129,7 @@ describe GoogleReader::Entry, "when no original ID is present" do
121
129
  end
122
130
 
123
131
  subject do
124
- GoogleReader::Entry.new(entry)
132
+ GoogleReader::Entry.new(entry, nil)
125
133
  end
126
134
 
127
135
  it { subject.original_id.should == subject.id }
data/spec/feed_spec.rb CHANGED
@@ -20,4 +20,8 @@ describe GoogleReader::Feed do
20
20
  it "should have an #udpated_at" do
21
21
  subject.updated_at.should == Time.utc(2011, 5, 2, 17, 53, 46)
22
22
  end
23
+
24
+ it "should provide itself to entries" do
25
+ subject.entries.first.feed.should == subject
26
+ end
23
27
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: google_reader
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.1
5
+ version: 1.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - "Fran\xC3\xA7ois Beausoleil"