Sha256: 6aa50da85bf787c77bb299e7abc53f85055fa80fa6efc47fb8afbb18307761a5

Contents?: true

Size: 735 Bytes

Versions: 1

Compression:

Stored size: 735 Bytes

Contents

require 'spec_helper'

describe Esearch::Connection, '.build' do
  let(:object) { described_class }

  subject { object.build(*arguments) }

  let(:url)        { double('URL')        }
  let(:logger)     { double('Logger')     }
  let(:connection) { double('Connection') }

  before do
    Faraday.should_receive(:new).with(url).and_return(connection)
  end

  context 'with one argument' do
    let(:arguments) { [url] }

    its(:raw_connection) { should be(connection)          }
    its(:logger)         { should be(NullLogger.instance) }
  end

  context 'with twi arguments' do
    let(:arguments) { [url, logger] }

    its(:raw_connection) { should be(connection) }
    its(:logger)         { should be(logger)     }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
esearch-0.2.1 spec/unit/esearch/connection/class_methods/build_spec.rb