spec/apitizer/connection/adaptor_spec.rb in apitizer-0.0.2 vs spec/apitizer/connection/adaptor_spec.rb in apitizer-0.0.3

- old
+ new

@@ -2,20 +2,20 @@ RSpec.describe Apitizer::Connection::Adaptor do let(:parent_module) { Apitizer::Connection } let(:address) { 'https://service.com/api/articles' } - shared_examples 'a proper postman' do |method:| + shared_examples 'a proper postman' do |method| it 'takes into account headers' do headers = { 'Secret-Token' => 'arbitrary' } stub = stub_http_request(method, address).with(headers: headers) subject.process(method, address, {}, headers) expect(stub).to have_been_requested end end - shared_examples '#call of a Rack app' do |method:| + shared_examples '#call of a Rack app' do |method| let(:code) { 200 } let(:headers) { { 'a' => [ 'b' ] } } let(:body) { 'Hej!' } before(:each) do @@ -58,12 +58,12 @@ subject { parent_module::Adaptor::Standard.new } describe '#process' do [ :get ].each do |method| context "when sending #{ method } requests" do - it_behaves_like '#call of a Rack app', method: method - it_behaves_like 'a proper postman', method: method + it_behaves_like '#call of a Rack app', method + it_behaves_like 'a proper postman', method it 'encodes parameters into the URI' do stub = stub_http_request(method, address).with(query: { life: 42 }) subject.process(method, address, life: 42) expect(stub).to have_been_requested @@ -71,11 +71,11 @@ end end [ :post, :put, :patch, :delete ].each do |method| context "when sending #{ method } requests" do - it_behaves_like '#call of a Rack app', method: method - it_behaves_like 'a proper postman', method: method + it_behaves_like '#call of a Rack app', method + it_behaves_like 'a proper postman', method it 'encodes parameters into the body' do stub = stub_http_request(method, address).with(body: 'life=42') response = subject.process(method, address, life: 42) expect(stub).to have_been_requested