Sha256: dc281f4a17450a81a5bf1e17fb70c6805f221c99adcee41cfc7d3ec1e0f995b9

Contents?: true

Size: 1.31 KB

Versions: 28

Compression:

Stored size: 1.31 KB

Contents

# encoding: utf-8

require 'ostruct'
require 'sunspot'

require File.join(File.dirname(__FILE__), 'mocks', 'mock_record.rb')
Dir.glob(File.join(File.dirname(__FILE__), 'mocks', '**', '*.rb')).each do |file|
  require file unless File.basename(file) == 'mock_record.rb'
end
Dir.glob(File.join(File.dirname(__FILE__), "helpers", "*.rb")).each do |file|
  require file
end
require File.join(File.dirname(__FILE__), 'ext')

RSpec.configure do |config|
  # Mock session available to all spec/api tests
  config.include MockSessionHelper,
                 :type => :api,
                 :example_group => {:file_path => /spec[\\\/]api/}

  # Real Solr instance is available to integration tests
  config.include IntegrationHelper,
                 :type => :integration,
                 :example_group => {:file_path => /spec[\\\/]integration/}

  # Nested under spec/api
  [:indexer, :query, :search].each do |spec_type|
    helper_name = "#{spec_type}_helper"

    config.include Sunspot::Util.full_const_get(Sunspot::Util.camel_case(helper_name)),
                   :type          => spec_type,
                   :example_group => {:file_path => /spec[\\\/]api[\\\/]#{spec_type}/}
  end
end

def without_class(clazz)
  Object.class_eval { remove_const(clazz.name.to_sym) }
  yield
  Object.class_eval { const_set(clazz.name.to_sym, clazz) }
end

Version data entries

28 entries across 28 versions & 6 rubygems

Version Path
sunspot-2.1.1 spec/spec_helper.rb
sunspot-2.1.0 spec/spec_helper.rb
sunspot-2.0.0 spec/spec_helper.rb
sunspot-2.0.0.pre.130115 spec/spec_helper.rb
gojee-sunspot-2.0.5 spec/spec_helper.rb
sunspot-2.0.0.pre.120925 spec/spec_helper.rb
sunspot_solr-2.0.0.pre.120924 sunspot/spec/spec_helper.rb
sunspot_rails-2.0.0.pre.120924 sunspot/spec/spec_helper.rb
sunspot-2.0.0.pre.120924 sunspot/spec/spec_helper.rb
gojee-sunspot-2.0.4 spec/spec_helper.rb
gojee-sunspot-2.0.2 spec/spec_helper.rb
sunspot-2.0.0.pre.120720 spec/spec_helper.rb
sunspot-1.3.3 spec/spec_helper.rb
sunspot-1.3.2 spec/spec_helper.rb
sunspot-2.0.0.pre.120417 spec/spec_helper.rb
sunspot-2.0.0.pre.120415 spec/spec_helper.rb
sunspot-1.3.1 spec/spec_helper.rb
erichummel-sunspot-2.0.0.pre.111215d spec/spec_helper.rb
erichummel-sunspot-2.0.0.pre.111215c spec/spec_helper.rb
erichummel-sunspot-2.0.0.pre.111215b spec/spec_helper.rb