spec/spec_helper.rb in rom-sql-0.4.0 vs spec/spec_helper.rb in rom-sql-0.4.1

- old
+ new

@@ -11,17 +11,29 @@ require 'rom-sql' require 'rom/sql/rake_task' # FIXME: why do we need to require it manually?? require 'sequel/adapters/postgres' require 'logger' +begin + require 'byebug' +rescue LoadError +end 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