mirror of
https://github.com/samsonjs/instapaper.git
synced 2026-03-25 08:55:49 +00:00
implement Instapaper::BookmarkList#each
This commit is contained in:
parent
96490cc9db
commit
e3f3f74d64
2 changed files with 16 additions and 0 deletions
|
|
@ -12,5 +12,9 @@ module Instapaper
|
|||
attribute :highlights, Array[Instapaper::Highlight]
|
||||
attribute :delete_ids, Array[Integer]
|
||||
end
|
||||
|
||||
def each
|
||||
bookmarks.each { |bookmark| yield(bookmark) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
12
spec/instapaper/bookmark_list_spec.rb
Normal file
12
spec/instapaper/bookmark_list_spec.rb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Instapaper::BookmarkList do
|
||||
describe '#each' do
|
||||
it 'yields a list of bookmarks' do
|
||||
list = Instapaper::BookmarkList.new(JSON.parse(fixture('bookmarks_list.json').read))
|
||||
list.each do |bookmark|
|
||||
expect(bookmark).to be_an Instapaper::Bookmark
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in a new issue