Sha256: be4e6b178bfe579c07bbea58e0e3c74698c1c4882b59e62fc1a74a00cb2aba58

Contents?: true

Size: 1.09 KB

Versions: 4

Compression:

Stored size: 1.09 KB

Contents

# encoding: utf-8

# this is needed for guard to work, not sure why :(
require "bundler"
Bundler.setup

if ENV['COVERAGE'] == 'true' && RUBY_ENGINE == 'ruby' && RUBY_VERSION >= '2.4.0' && ENV['CI'] == 'true'
  require 'simplecov'
  SimpleCov.start do
    add_filter '/spec/'
  end
end

require 'rom-sql'
require 'rom-repository'

begin
  require 'byebug'
rescue LoadError
end

root = Pathname(__FILE__).dirname
LOGGER = Logger.new(File.open('./log/test.log', 'a'))

Dir[root.join('support/*.rb').to_s].each do |f|
  require f
end

Dir[root.join('shared/*.rb').to_s].each do |f|
  require f
end

require 'dry/core/deprecations'
Dry::Core::Deprecations.set_logger!(root.join('../log/deprecations.log'))

# Make inference errors quiet
class ROM::SQL::Schema::Inferrer
  def self.on_error(*args)
    # shush
  end
end

# Namespace holding all objects created during specs
module Test
  def self.remove_constants
    constants.each(&method(:remove_const))
  end
end

RSpec.configure do |config|
  config.after do
    Test.remove_constants
  end

  config.include(MapperRegistry)

  config.disable_monkey_patching!
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rom-repository-1.3.0 spec/spec_helper.rb
rom-repository-1.2.0 spec/spec_helper.rb
rom-repository-1.1.0 spec/spec_helper.rb
rom-repository-1.0.2 spec/spec_helper.rb