Sha256: b2df85c1a5faeaf40a3d918216d595009f0acef8e8f675e60d245f8621ab210f
Contents?: true
Size: 1.1 KB
Versions: 4
Compression:
Stored size: 1.1 KB
Contents
# encoding: utf-8 require 'bundler' Bundler.setup if RUBY_ENGINE == 'rbx' require "codeclimate-test-reporter" CodeClimate::TestReporter.start end require 'rom-sql' require 'rom/sql/rake_task' # FIXME: why do we need to require it manually?? require 'sequel/adapters/postgres' require 'active_support/inflector' require 'logger' begin require 'byebug' rescue LoadError end ROM.use :auto_registration LOGGER = Logger.new(File.open('./log/test.log', 'a')) DB_URI = 'postgres://localhost/rom' root = Pathname(__FILE__).dirname TMP_PATH = root.join('../tmp') Dir[root.join('shared/*.rb').to_s].each { |f| require f } RSpec.configure do |config| config.before(:suite) do tmp_test_dir = TMP_PATH.join('test') FileUtils.rm_r(tmp_test_dir) if File.exist?(tmp_test_dir) FileUtils.mkdir_p(tmp_test_dir) end config.before do @constants = Object.constants end config.after do added_constants = Object.constants - @constants added_constants.each { |name| Object.send(:remove_const, name) } ROM.instance_variable_get('@environment').instance_variable_set('@gateways', {}) end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
rom-sql-0.6.1 | spec/spec_helper.rb |
rom-sql-0.6.0 | spec/spec_helper.rb |
rom-sql-0.6.0.rc1 | spec/spec_helper.rb |
rom-sql-0.6.0.beta1 | spec/spec_helper.rb |