Sha256: 3c62303349a2192d63ad1206c11fd9901a1d4b3801f46bbb5103218a9b9c0170

Contents?: true

Size: 871 Bytes

Versions: 12

Compression:

Stored size: 871 Bytes

Contents

require 'spec_helper'

describe SolrWrapper do
  # WebMock messes with HTTP.rbs ability to stream responses
  before(:all) do
    WebMock.disable!
  end

  after(:all) do
    WebMock.enable!
  end

  describe ".wrap" do
    it "should launch solr" do
      SolrWrapper.wrap do |solr|
        expect do
          Timeout::timeout(15) do
            TCPSocket.new('127.0.0.1', solr.port).close
          end
        end.not_to raise_exception
      end
    end
  end

  describe '.instance' do
    context 'without arguments' do
      it 'inherits the defaults' do
        expect(SolrWrapper.instance.port).to eq '8983'
      end
    end
  end

  describe ".default_instance_options=" do
    it "sets default options" do
      SolrWrapper.default_instance_options = { port: '1234' }
      expect(SolrWrapper.default_instance_options[:port]). to eq '1234'
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
solr_wrapper-4.1.0 spec/lib/solr_wrapper_spec.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/solr_wrapper-4.0.2/spec/lib/solr_wrapper_spec.rb
solr_wrapper-4.0.2 spec/lib/solr_wrapper_spec.rb
solr_wrapper-4.0.1 spec/lib/solr_wrapper_spec.rb
solr_wrapper-4.0.0 spec/lib/solr_wrapper_spec.rb
solr_wrapper-3.1.3 spec/lib/solr_wrapper_spec.rb
solr_wrapper-3.1.2 spec/lib/solr_wrapper_spec.rb
solr_wrapper-3.1.1 spec/lib/solr_wrapper_spec.rb
solr_wrapper-3.1.0 spec/lib/solr_wrapper_spec.rb
solr_wrapper-3.0.2 spec/lib/solr_wrapper_spec.rb
solr_wrapper-3.0.1 spec/lib/solr_wrapper_spec.rb
solr_wrapper-3.0.0 spec/lib/solr_wrapper_spec.rb