Sha256: cf84e5dafd7f3d685397a6927e9f88722b2a2089eb10a42155ef345d76ab088b

Contents?: true

Size: 651 Bytes

Versions: 12

Compression:

Stored size: 651 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 'ruby-debug'

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

12 entries across 12 versions & 5 rubygems

Version Path
bsy-sunspot_rails-0.10.4 spec/spec_helper.rb
kuahyeow-sunspot_rails-0.10.5 spec/spec_helper.rb
outoftime-sunspot_rails-0.10.0 spec/spec_helper.rb
outoftime-sunspot_rails-0.10.1 spec/spec_helper.rb
outoftime-sunspot_rails-0.10.2 spec/spec_helper.rb
outoftime-sunspot_rails-0.10.3 spec/spec_helper.rb
outoftime-sunspot_rails-0.10.4 spec/spec_helper.rb
outoftime-sunspot_rails-0.9.11 spec/spec_helper.rb
outoftime-sunspot_rails-0.9.12 spec/spec_helper.rb
pallan-sunspot_rails-0.9.10 spec/spec_helper.rb
pallan-sunspot_rails-0.9.12 spec/spec_helper.rb
sunspot_rails-0.10.4 spec/spec_helper.rb