Sha256: 125964bef7b6bf7593d607a6bf604e324604f3a57311c34084211bd9913182de

Contents?: true

Size: 497 Bytes

Versions: 10

Compression:

Stored size: 497 Bytes

Contents

require 'rails_helper'

describe LHC do

  context 'interceptor' do

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

    it 'can perform some actions after a request was fired' do
      expect_any_instance_of(SomeInterceptor).to receive(:after_request)
      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/after_request_spec.rb
lhc-3.3.0 spec/interceptors/after_request_spec.rb
lhc-3.2.0 spec/interceptors/after_request_spec.rb
lhc-3.1.1 spec/interceptors/after_request_spec.rb
lhc-3.1.0 spec/interceptors/after_request_spec.rb
lhc-3.0.0 spec/interceptors/after_request_spec.rb
lhc-2.0.0 spec/interceptors/after_request_spec.rb
lhc-1.2.0 spec/interceptors/after_request_spec.rb
lhc-1.1.0 spec/interceptors/after_request_spec.rb
lhc-0.2.1 spec/interceptors/after_request_spec.rb