Sha256: c65b99cbb980e61764ee07c47e5228206e40ea798d8c763c325776b98d90019c

Contents?: true

Size: 882 Bytes

Versions: 28

Compression:

Stored size: 882 Bytes

Contents

# $:.unshift(File.expand_path('../../lib', __FILE__))

ENV['RACK_ENV'] = 'test'
require 'snails'

# require 'bundler'
# Bundler.require(:default, :test)

RSpec.configure do |config|
  def db_name
    ActiveRecord::Base.connection.instance_variable_get('@config')[:database]
  end

  def load_db!
    db_schema = "./db/schema.rb"
    if defined?(ActiveRecord) and File.exist?(db_schema) and db_name == ':memory:'
      puts "Loading in-memory database schema."
      load db_schema
    end
  end

  # config.include Capybara
  # config.include FactoryGirl::Syntax::Methods
  # config.include RequestHelpers, type: :request
  # config.include ControllerTestHelpers, type: :controller
  # config.expect_with(:rspec) { |c| c.syntax = :expect }

  # config.order = 'random'
  config.formatter = 'Fuubar' if defined?(Fuubar)
  config.color = true
  config.before(:suite) { load_db! }
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
snails-0.9.0 lib/snails/rspec.rb
snails-0.8.1 lib/snails/rspec.rb
snails-0.8.0 lib/snails/rspec.rb
snails-0.7.0 lib/snails/rspec.rb
snails-0.6.1 lib/snails/rspec.rb
snails-0.6.0 lib/snails/rspec.rb
snails-0.5.6 lib/snails/rspec.rb
snails-0.5.5 lib/snails/rspec.rb
snails-0.5.4 lib/snails/rspec.rb
snails-0.5.3 lib/snails/rspec.rb
snails-0.5.2 lib/snails/rspec.rb
snails-0.5.1 lib/snails/rspec.rb
snails-0.5.0 lib/snails/rspec.rb
snails-0.4.3 lib/snails/rspec.rb
snails-0.4.2 lib/snails/rspec.rb
snails-0.4.0 lib/snails/rspec.rb
snails-0.3.8 lib/snails/rspec.rb
snails-0.3.7 lib/snails/rspec.rb
snails-0.3.6 lib/snails/rspec.rb
snails-0.3.5 lib/snails/rspec.rb