Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Commit

Permalink
Fixed bug when Picasa photos had comments.
Browse files Browse the repository at this point in the history
Note that I broke a spec concerning how class_from_xml responds to invalid
feed types, though I'm not sure why it worked in the first place. If there are
any rspec gurus reading, I'd appreciate some input.
  • Loading branch information
kueda committed Dec 29, 2009
1 parent c94e9f0 commit 87c8109
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 3 additions & 6 deletions lib/ruby_picasa.rb
Original file line number Diff line number Diff line change
Expand Up @@ -351,19 +351,16 @@ def class_from_xml(xml)
RubyPicasa::User.new(xml, self)
when /#photo$/
RubyPicasa::RecentPhotos.new(xml, self)
when nil
else
RubyPicasa::Search.new(xml, self)
end
when /#album$/
case entry_scheme
when nil, /#photo$/
RubyPicasa::Album.new(xml, self)
end
RubyPicasa::Album.new(xml, self)
when /#photo$/
case entry_scheme
when /#photo$/
RubyPicasa::Search.new(xml, self)
when nil
else
if feed_href && (feed_href.starts_with? 'http://picasaweb.google.com/data/feed/api/all')
RubyPicasa::Search.new(xml, self)
else
Expand Down
5 changes: 4 additions & 1 deletion spec/ruby_picasa_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,10 @@ def to_create(klass, feed, entry)
it('photo nil') { to_create RubyPicasa::Photo, @photo, nil }
it('photo photo') { to_create RubyPicasa::Search, @photo, @photo }
end


# I broke this test, though I'm not sure how to fix it (or why it ever
# worked to begin with). Shouldn't it always break when you pass in a
# symbol instead of actual xml? -- kueda 2009-12-29
it 'should raise an error for invalid feed category types' do
@p.expects(:xml_data).with(:xml).returns([:xml, @album, @user])
lambda do
Expand Down

0 comments on commit 87c8109

Please sign in to comment.