Sha256: 2466f58c98013d665dd486e7edc19449765581d50f95c0bc9bb8732e4dea70fb

Contents?: true

Size: 726 Bytes

Versions: 6

Compression:

Stored size: 726 Bytes

Contents

ENV['RAILS_ENV'] = 'test'
ENV['RAILS_ROOT'] ||= File.join(File.dirname(__FILE__), 'mock_app')

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

require 'spec'
require 'spec/rails'
require 'rake'
require 'ruby-debug' unless RUBY_VERSION =~ /1\.9/
require 'sunspot/rails/tasks'

def load_schema
  stdout = $stdout
  $stdout = StringIO.new # suppress output while building the schema
  load File.join(File.dirname(__FILE__), 'schema.rb')
  $stdout = stdout
end

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

Spec::Runner.configure do |config|
  config.before(:each) do
    Sunspot.remove_all
    Sunspot.commit
    load_schema
  end
end

Version data entries

6 entries across 6 versions & 4 rubygems

Version Path
kristopher-sunspot_rails-0.10.6 spec/spec_helper.rb
outoftime-sunspot_rails-0.10.5 spec/spec_helper.rb
ssoroka-sunspot_rails-0.10.5 spec/spec_helper.rb
ssoroka-sunspot_rails-0.10.6 spec/spec_helper.rb
goldstar-sunspot_rails-0.10.6.3 spec/spec_helper.rb
goldstar-sunspot_rails-0.10.6.1 spec/spec_helper.rb