Sha256: 3cdea84cf2897c8f9fa4edf8a7832d35707f9f8d29caf5894dc56a366160e557

Contents?: true

Size: 504 Bytes

Versions: 10

Compression:

Stored size: 504 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.4.0 spec/interceptors/before_response_spec.rb
lhc-3.3.0 spec/interceptors/before_response_spec.rb
lhc-3.2.0 spec/interceptors/before_response_spec.rb
lhc-3.1.1 spec/interceptors/before_response_spec.rb
lhc-3.1.0 spec/interceptors/before_response_spec.rb
lhc-3.0.0 spec/interceptors/before_response_spec.rb
lhc-2.0.0 spec/interceptors/before_response_spec.rb
lhc-1.2.0 spec/interceptors/before_response_spec.rb
lhc-1.1.0 spec/interceptors/before_response_spec.rb
lhc-0.2.1 spec/interceptors/before_response_spec.rb