Sha256: 2950a2bd75685caf32e805696cd2b368690447f582ab39722d72991a7fb94776

Contents?: true

Size: 834 Bytes

Versions: 1

Compression:

Stored size: 834 Bytes

Contents

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'simple_solr_client'
require 'minitest/spec'
require 'minitest/autorun'
require "minitest/reporters"
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new

require 'singleton'

ENV['TEST_SOLR_URL'] ||= 'http://localhost:8983/solr'
ENV['TEST_SOLR_CORE'] ||= 'core1'

class TestClient
  include Singleton
  attr_reader :client, :core
  def initialize
    @client = SimpleSolrClient::Client.new ENV['TEST_SOLR_URL']
    @core = @client.core ENV['TEST_SOLR_CORE']
  end
end

class TempCore
  include Singleton
  attr_reader :client
  def initialize
    @client = TestClient.instance.client
    @tempcores = {}
    Minitest.after_run { @client.unload_temp_cores }
  end

  def core(name)
    @tempcores[name] ||= @client.temp_core
    @tempcores[name]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simple_solr_client-0.1.2 spec/minitest_helper.rb