Sha256: 0df6878509354f9b68954e3dcc6a11a9e8bc7f83cb26f6f5b97a2ab983b21270
Contents?: true
Size: 582 Bytes
Versions: 10
Compression:
Stored size: 582 Bytes
Contents
require 'database_cleaner' RSpec.configure do |config| config.before(:suite) do if defined?(::DB) DatabaseCleaner.strategy = :transaction if DB.mysql? DatabaseCleaner.clean_with :deletion else DatabaseCleaner.clean_with :truncation end end end config.before(:each) do | example | unless example.metadata[:no_db_clean] DatabaseCleaner.start if defined?(::DB) end end config.after(:each) do | example | unless example.metadata[:no_db_clean] DatabaseCleaner.clean if defined?(::DB) end end end
Version data entries
10 entries across 10 versions & 1 rubygems