spec/spec_helper.rb in saviour-0.2.3 vs spec/spec_helper.rb in saviour-0.3.0

- old
+ new

@@ -1,39 +1,11 @@ -require "codeclimate-test-reporter" -CodeClimate::TestReporter.start +require 'simplecov' +SimpleCov.start require 'bundler/setup' require 'rspec' -require 'active_record' -require 'sqlite3' -require 'logger' require File.expand_path("../../lib/saviour", __FILE__) - -connection_opts = case ENV.fetch('DB', "sqlite") - when "sqlite" - {adapter: "sqlite3", database: ":memory:"} - when "mysql" - {adapter: "mysql2", database: "saviour", username: "root", encoding: "utf8"} - when "postgres" - {adapter: "postgresql", database: "saviour", username: "postgres"} - end - -ActiveRecord::Base.establish_connection(connection_opts) - -ActiveRecord::Base.logger = Logger.new(STDOUT) if ENV['DEBUG'] - -def silence_stream(stream) - old_stream = stream.dup - stream.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null') - stream.sync = true - yield -ensure - stream.reopen(old_stream) - old_stream.close -end - -silence_stream(STDOUT) { require 'support/schema' } require 'support/models' RSpec.configure do |config| config.around do |example|