Sha256: 3f9cd90aff1a307fd946b0e2dc909914f85117706844cdcd43b361a97b700e43

Contents?: true

Size: 939 Bytes

Versions: 6

Compression:

Stored size: 939 Bytes

Contents

require 'active_record'
require 'database_cleaner'

db_dir = File.join(File.expand_path(__dir__ ), "ar_support/db/")
# ENV['DATABASE_URL']="sqlite3://localhost/:memory:?pool=5&timeout=5000"



ActiveRecord::Base.establish_connection({
                                            pool: 5,
                                            timeout: 5000,
                                            database: ":memory:",
                                            adapter: "sqlite3"
                                        })

ActiveRecord::Migrator.migrate "#{db_dir}/migrate"

Dir[File.join(File.expand_path(__dir__ ), "ar_support/models/**/*.rb")].each { |f| require f }

RSpec.configure do |config|

  config.before(:suite) do
    DatabaseCleaner.strategy = :transaction
    DatabaseCleaner.clean_with(:truncation)
  end

  config.before(:each) do
    DatabaseCleaner.start
  end

  config.after(:each) do
    DatabaseCleaner.clean
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
activerecord_to_poro-0.0.8 spec/ar_spec_helper.rb
activerecord_to_poro-0.0.7 spec/ar_spec_helper.rb
activerecord_to_poro-0.0.6 spec/ar_spec_helper.rb
activerecord_to_poro-0.0.5 spec/ar_spec_helper.rb
activerecord_to_poro-0.0.4 spec/ar_spec_helper.rb
activerecord_to_poro-0.0.3 spec/ar_spec_helper.rb