Sha256: cc72baf5003298d3eb9fc12b0147d49d0733dd90af1a1bd3db9269a8be218920

Contents?: true

Size: 519 Bytes

Versions: 5

Compression:

Stored size: 519 Bytes

Contents

require 'rails_helper'

describe LHC do
  context 'interceptor' do
    before(:each) do
      class SomeInterceptor < LHC::Interceptor
        def after_request(request)
        end
      end
      described_class.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')
      described_class.get('http://local.ch')
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lhc-3.5.4 spec/interceptors/after_request_spec.rb
lhc-3.5.3 spec/interceptors/after_request_spec.rb
lhc-3.5.2 spec/interceptors/after_request_spec.rb
lhc-3.5.1 spec/interceptors/after_request_spec.rb
lhc-3.5.0 spec/interceptors/after_request_spec.rb