Sha256: 4baf43d80849eee64cc19d849cf8ab4ceeef4495362713198eed58fe2b872e5a
Contents?: true
Size: 1.16 KB
Versions: 17
Compression:
Stored size: 1.16 KB
Contents
# encoding: utf-8 require 'spec_helper' describe Actions::FetchUrls do context '#initialize' do it 'requires a set of options' do proxy = double('HttpProxy') reporter = double('reporter') allow(reporter).to receive(:header) options = { proxy: proxy, urls: ['http://localhost:4567/rspec/url_fetcher'], timeout: 2, count: 1, concurrent: false, output: StringIO.new, reporter: reporter, } expect { Actions::FetchUrls.new(options) }.not_to raise_error end end context '#run' do it 'fetchs urls' do proxy = double('HttpProxy') allow(proxy).to receive(:to_string).and_return('http://localhost:3128') reporter = double('reporter') allow(reporter).to receive(:data) allow(reporter).to receive(:header) options = { proxy: proxy, urls: ['http://example.org'], timeout: 2, count: 2, output: StringIO.new, concurrent: false, reporter: reporter, } fetcher = Actions::FetchUrls.new(options) silence :stderr do fetcher.run end end end end
Version data entries
17 entries across 17 versions & 1 rubygems