require'spec_helper'# Emulates paginator. It returns 2 pages with resultsclassTestPaginatordefinitialize@current_page=0enddefitems@current_page+=1raiseStopIterationif@current_page>2["result_1_page_#{@current_page}","result_2_page_#{@current_page}"]endenddescribeBitbucket::Collectiondoit"iterates paginator"docollection=described_class.new(TestPaginator.new)