Sha256: b1e720281b7e68f7118553f477a791d783818c227b86e8fc2e25443d60e9b720
Contents?: true
Size: 1.29 KB
Versions: 17
Compression:
Stored size: 1.29 KB
Contents
# encoding: utf-8 require 'spec_helper' describe Reporters::FetchUrls do context '#initialize' do it 'does not require any parameter' do expect { Reporters::FetchUrls.new }.not_to raise_error end it 'accepts an io object' do expect { Reporters::FetchUrls.new(StringIO.new) }.not_to raise_error end end context '#data' do let(:data) { { headers: { "Date" => "Fri, 21 Mar 2014 09:49:09 GMT", "Server" => "Apache", "Location" => "http://www.sg-zertifikate.de/dwr/call/plainpoll/ReverseAjax.dwr", "Content-Length" => "271", "Content-Type" => "text/html; charset=iso-8859-1", "Connection" => "close", "Age" => "1" }, status: 301, url: 'http://www.sg-zertifikate.de/dwr/call/plainpoll/ReverseAjax.dwr', proxy: 'proxy:3128', } } it 'generates output' do reporter = Reporters::FetchUrls.new result = capture :stdout do reporter.data(data) end expect(result).to match(/url\s+:/) end it 'uses io object' do output = StringIO.new reporter = Reporters::FetchUrls.new(output) reporter.data(data) expect(output.string).to match(/url\s+:/) end end end
Version data entries
17 entries across 17 versions & 1 rubygems