Sha256: 1f724116797a108918cf8521936e54794e4b4aaa17fab2f325d0d8fd653f498c

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

Contents

shared_examples 'available http request methods' do
  it "instantiates a new Request object" do
    VCR.use_cassette("client/#{http_method}/request") do
      expect(Myfinance::Request).to receive(:new).and_call_original
      subject.send(http_method, url, body: params)
    end
  end

  it 'runs the request' do
    VCR.use_cassette("client/#{http_method}/request") do
      expect_any_instance_of(Myfinance::Request).to receive(:run).and_call_original
      subject.send(http_method, url, body: params)
    end
  end

  it 'instantiates a new Response object' do
    VCR.use_cassette("client/#{http_method}/request") do
      expect(Myfinance::Response).to receive(:new).and_call_original
      subject.send(http_method, url, body: params)
    end
  end

  it 'resolves the response of the request a new Response object' do
    VCR.use_cassette("client/#{http_method}/request") do
      expect_any_instance_of(Myfinance::Response).to receive(:resolve!).and_call_original
      subject.send(http_method, url, body: params)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
myfinance-0.2.0 spec/support/shared_examples/http_request_methods.rb
myfinance-0.1.0 spec/support/shared_examples/http_request_methods.rb