Sha256: 1555d3a1feae6624df35565880e86cb1ed16286eb0e6208fddae5511f3a64aca

Contents?: true

Size: 502 Bytes

Versions: 10

Compression:

Stored size: 502 Bytes

Contents

require 'rails_helper'

describe LHC do
  context 'interceptor' do
    before(:each) do
      class SomeInterceptor < LHC::Interceptor
        def before_response(request)
        end
      end
      LHC.configure { |c| c.interceptors = [SomeInterceptor] }
    end

    it 'can perform some actions before a reponse is received' do
      expect_any_instance_of(SomeInterceptor).to receive(:before_response)
      stub_request(:get, 'http://local.ch')
      LHC.get('http://local.ch')
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
lhc-3.8.0 spec/interceptors/before_response_spec.rb
lhc-3.7.3 spec/interceptors/before_response_spec.rb
lhc-3.7.2 spec/interceptors/before_response_spec.rb
lhc-3.7.2.1 spec/interceptors/before_response_spec.rb
lhc-3.7.1 spec/interceptors/before_response_spec.rb
lhc-3.7.0 spec/interceptors/before_response_spec.rb
lhc-3.7.0.pre1 spec/interceptors/before_response_spec.rb
lhc-3.6.1 spec/interceptors/before_response_spec.rb
lhc-3.6.0 spec/interceptors/before_response_spec.rb
lhc-3.5.5 spec/interceptors/before_response_spec.rb