Skip to content

Commit

Permalink
Make SVN scraper order independent, too.
Browse files Browse the repository at this point in the history
  • Loading branch information
Graham Hughes committed Aug 24, 2011
1 parent c6d4f3d commit c17a406
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions right_scraper_svn/spec/svn_scraper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,23 @@ def secondary_cookbook(where)
include RightScraper::SpecHelpers::FromScratchScraping

it 'should scrape' do
@cookbook_places.each do |place|
check_cookbook @scraper.next, :position => place[@helper.repo_path.length+1..-1]
scraped = []
while scrape = @scraper.next
place = (@cookbook_places - scraped).detect {|place| File.join(@helper.repo_path, scrape.pos) == place}
scraped << place
check_cookbook scrape, :position => scrape.pos
end
scraped.should have(@cookbook_places.size).repositories
end

it 'should be able to seek' do
@scraper.seek "cookbooks/second"
check_cookbook @scraper.next, :position => "cookbooks/second"
check_cookbook @scraper.next, :position => "other_random_place"
order = []
while scrape = @scraper.next
order << scrape.pos
end
@scraper.seek order[1]
check_cookbook @scraper.next, :position => order[1]
check_cookbook @scraper.next, :position => order[2]
end
end

Expand Down

0 comments on commit c17a406

Please sign in to comment.