Make Docs::UrlScraper#request_all accept an array of URLs

pull/29/head
Thibaut 11 years ago
parent c6be9b6ae4
commit cd6057e392

@ -17,8 +17,8 @@ module Docs
Request.run url, request_options
end
def request_all(url, &block)
Requester.run url, request_options: request_options, &block
def request_all(urls, &block)
Requester.run urls, request_options: request_options, &block
end
def request_options

@ -50,11 +50,11 @@ class DocsUrlScraperTest < MiniTest::Spec
end
let :result do
scraper.send :request_all, 'url', &block
scraper.send :request_all, 'urls', &block
end
it "runs a Requester with the given url" do
mock(Docs::Requester).run 'url', anything
it "runs a Requester with the given urls" do
mock(Docs::Requester).run 'urls', anything
result
end
@ -65,7 +65,7 @@ class DocsUrlScraperTest < MiniTest::Spec
end
it "runs a Requester with the given block" do
mock(Docs::Requester).run.with_any_args { |*args| @block = args.last }
stub(Docs::Requester).run { |*args| @block = args.last }
result
assert_equal block, @block
end

Loading…
Cancel
Save