lib/webmock-rspec-helper.rb in webmock-rspec-helper-0.0.4 vs lib/webmock-rspec-helper.rb in webmock-rspec-helper-0.0.5

- old
+ new

@@ -3,11 +3,11 @@ module WebMock module RSpec module Helper - def webmock(method, mocks = {}, with: false) + def webmock(method, mocks = {}, with: false, headers: nil) mocks.each do |regex, result| if result.to_s =~ /\A\d+\z/ status = result body = '' else @@ -15,10 +15,10 @@ body = File.read Rails.root.join('spec', 'support', 'stubs', result) end stub = WebMock.stub_request(method, regex) stub.with(with) if with - stub.to_return status: status.to_i, body: body + stub.to_return status: status.to_i, body: body, headers: headers end end end end