Sha256: 4c53a256f487dc39a9f001d15a502bccc628686525e9e975bc1123edc6cf6257

Contents?: true

Size: 1003 Bytes

Versions: 108

Compression:

Stored size: 1003 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Faraday do
  it 'has a version number' do
    expect(Faraday::VERSION).not_to be nil
  end

  context 'proxies to default_connection' do
    let(:mock_connection) { double('Connection') }
    before do
      Faraday.default_connection = mock_connection
    end

    it 'proxies methods that exist on the default_connection' do
      expect(mock_connection).to receive(:this_should_be_proxied)

      Faraday.this_should_be_proxied
    end

    it 'uses method_missing on Faraday if there is no proxyable method' do
      expect { Faraday.this_method_does_not_exist }.to raise_error(
        NoMethodError,
        "undefined method `this_method_does_not_exist' for Faraday:Module"
      )
    end

    it 'proxied methods can be accessed' do
      allow(mock_connection).to receive(:this_should_be_proxied)

      expect(Faraday.method(:this_should_be_proxied)).to be_a(Method)
    end

    after do
      Faraday.default_connection = nil
    end
  end
end

Version data entries

108 entries across 95 versions & 16 rubygems

Version Path
tdiary-5.1.5 vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/spec/faraday_spec.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/faraday-1.1.0/spec/faraday_spec.rb
logstash-output-newrelic-1.2.0 vendor/bundle/jruby/2.5.0/gems/faraday-1.3.0/spec/faraday_spec.rb
faraday-1.3.0 spec/faraday_spec.rb
faraday-1.2.0 spec/faraday_spec.rb
tdiary-5.1.4 vendor/bundle/ruby/2.7.0/gems/faraday-1.1.0/spec/faraday_spec.rb
passbase-1.2.0 vendor/bundle/ruby/2.7.0/gems/faraday-1.1.0/spec/faraday_spec.rb
passbase-1.1.0 vendor/bundle/ruby/2.7.0/gems/faraday-1.1.0/spec/faraday_spec.rb
passbase-1.0.3 vendor/bundle/ruby/2.7.0/gems/faraday-1.1.0/spec/faraday_spec.rb
faraday-1.1.0 spec/faraday_spec.rb
passbase-1.0.2 vendor/bundle/ruby/2.7.0/gems/faraday-1.0.1/spec/faraday_spec.rb
passbase-1.0.1 vendor/bundle/ruby/2.7.0/gems/faraday-1.0.1/spec/faraday_spec.rb
passbase-1.0.0 vendor/bundle/ruby/2.7.0/gems/faraday-1.0.1/spec/faraday_spec.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.5.0/gems/faraday-1.0.1/spec/faraday_spec.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.5.0/gems/faraday-1.0.1/spec/faraday_spec.rb
tdiary-5.1.3 vendor/bundle/ruby/2.6.0/gems/faraday-1.0.1/spec/faraday_spec.rb
tdiary-5.1.3 vendor/bundle/ruby/2.7.0/gems/faraday-1.0.1/spec/faraday_spec.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/faraday-1.0.1/spec/faraday_spec.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/faraday-1.0.1/spec/faraday_spec.rb
logstash-output-scalyr-0.1.5 vendor/bundle/jruby/2.5.0/gems/faraday-1.0.1/spec/faraday_spec.rb