# spec/test_spec.rb require 'spec_helper' describe Foo do let(:url) { 'http://google.com' } subject(:foo) { Foo.new(url) } before { stub_request(:get, /.*/).to_return(status: 200) } describe '#retrieve_files' do (1..4).each do |concurrency| context "when concurrency = #{concurrency}" do it 'returns all the files' do foo.retrieve_files(concurrency).should == foo.urls end end end end end