Sha256: 4b0804ebd42aefaea69660d8d2444d945d56eef92424aaf0c3fbe9c4c383f72b

Contents?: true

Size: 1.08 KB

Versions: 12

Compression:

Stored size: 1.08 KB

Contents

# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'

if RUBY_ENGINE == 'rbx'
  require "codeclimate-test-reporter"
  CodeClimate::TestReporter.start
end

require Pathname(__FILE__).dirname.join("dummy/config/environment")

require 'rspec/rails'
require 'database_cleaner'
require 'capybara/rails'
require 'generator_spec'

begin
  require 'byebug'
rescue LoadError
end

Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }

Dry::Core::Deprecations.set_logger!(Rails.root.join('log/deprecations.log'))

RSpec.configure do |config|
  config.disable_monkey_patching!
  config.example_status_persistence_file_path = "tmp/examples.txt"

  config.before(:suite) do
    conn = rom.gateways[:default].connection

    DatabaseCleaner[:sequel, connection: conn].strategy = :transaction
    DatabaseCleaner[:sequel, connection: conn].clean_with(:truncation)
  end

  config.around(:each) do |example|
    conn = rom.gateways[:default].connection

    DatabaseCleaner[:sequel, connection: conn].cleaning { example.run }
  end
end

def rom
  ROM.env
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rom-rails-2.4.0 spec/spec_helper.rb
rom-rails-2.3.1 spec/spec_helper.rb
rom-rails-2.3.0 spec/spec_helper.rb
rom-rails-2.2.0 spec/spec_helper.rb
rom-rails-2.0.0 spec/spec_helper.rb
rom-rails-1.2.0 spec/spec_helper.rb
rom-rails-1.1.1 spec/spec_helper.rb
rom-rails-1.1.0 spec/spec_helper.rb
rom-rails-1.0.1 spec/spec_helper.rb
rom-rails-1.0.0 spec/spec_helper.rb
rom-rails-1.0.0.rc1 spec/spec_helper.rb
rom-rails-1.0.0.beta1 spec/spec_helper.rb