Sha256: 435ac27a7c99688653580031736105c45670e0875f1b83dcd960b90134564f92

Contents?: true

Size: 754 Bytes

Versions: 1

Compression:

Stored size: 754 Bytes

Contents

# encoding: UTF-8

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.2 spec/unit/esearch/connection/class_methods/build_spec.rb