mirror of
https://github.com/samsonjs/instapaper.git
synced 2026-04-27 14:57:44 +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 :highlights, Array[Instapaper::Highlight]
|
||||||
attribute :delete_ids, Array[Integer]
|
attribute :delete_ids, Array[Integer]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def each
|
||||||
|
bookmarks.each { |bookmark| yield(bookmark) }
|
||||||
|
end
|
||||||
end
|
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