Sha256: 3f4f58fcc61ab113ec1c795ff7ba7c889aad0c7acf2e1165b85d47fd16ae43b5

Contents?: true

Size: 882 Bytes

Versions: 2

Compression:

Stored size: 882 Bytes

Contents

require 'sqlite3'
require 'active_record'
require 'database_cleaner'

db_dir = File.join(File.expand_path(__dir__ ), "ar_support/db/")

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

2 entries across 2 versions & 1 rubygems

Version Path
activerecord_to_poro-0.0.2 spec/ar_spec_helper.rb
activerecord_to_poro-0.0.1 spec/ar_spec_helper.rb