Sha256: 335b1193666bbe6ec871b06cfa5d298740f8511c59dee1653760ed291d7228ea

Contents?: true

Size: 952 Bytes

Versions: 12

Compression:

Stored size: 952 Bytes

Contents

ENV['RAILS_ENV'] = 'test'
ENV['RAILS_ROOT'] ||= File.join(File.dirname(__FILE__), 'rails3')
if rsolr_version = ENV['RSOLR_GEM_VERSION']
  STDERR.puts("Forcing RSolr version #{rsolr_version}")
  gem "rsolr", rsolr_version
end

require File.expand_path('config/environment', ENV['RAILS_ROOT'])

begin
  require 'rspec'
  require 'rspec/rails'
rescue LoadError => e
  require 'spec'
  require 'spec/rails'
end
require 'rake'
require File.join('sunspot', 'rails', 'solr_logging')

def load_schema
  stdout = $stdout
  $stdout = StringIO.new # suppress output while building the schema
  load File.join(ENV['RAILS_ROOT'], 'db', 'schema.rb')
  $stdout = stdout
end

def silence_stderr(&block)
  stderr = $stderr
  $stderr = StringIO.new
  yield
  $stderr = stderr
end

rspec = 
  begin
    RSpec
  rescue NameError, ArgumentError
    Spec::Runner
  end

rspec.configure do |config|
  config.before(:each) do
    load_schema
    Sunspot.remove_all!
  end
end

Version data entries

12 entries across 12 versions & 4 rubygems

Version Path
pduey-sunspot_rails-1.2.1.1 spec/spec_helper.rb
erichummel-sunspot_rails-1.2.1g spec/spec_helper.rb
erichummel-sunspot_rails-1.2.1f spec/spec_helper.rb
erichummel-sunspot_rails-1.2.1e spec/spec_helper.rb
erichummel-sunspot_rails-1.2.1d spec/spec_helper.rb
erichummel-sunspot_rails-1.2.1c spec/spec_helper.rb
erichummel-sunspot_rails-1.2.1b spec/spec_helper.rb
erichummel-sunspot_rails-1.2.1a spec/spec_helper.rb
sunspot_rails_rbg-1.3.1 spec/spec_helper.rb
sunspot_rails_rbg-1.3.0 spec/spec_helper.rb
sunspot_rails-1.2.1 spec/spec_helper.rb
sunspot_rails-1.2.0 spec/spec_helper.rb