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

Version Path
pact_broker-2.4.2 spec/support/database_cleaner.rb
pact_broker-2.4.1 spec/support/database_cleaner.rb
pact_broker-2.4.0 spec/support/database_cleaner.rb
pact_broker-2.3.0 spec/support/database_cleaner.rb
pact_broker-2.2.0 spec/support/database_cleaner.rb
pact_broker-2.1.1 spec/support/database_cleaner.rb
pact_broker-2.1.0 spec/support/database_cleaner.rb
pact_broker-2.0.5 spec/support/database_cleaner.rb
pact_broker-2.0.4 spec/support/database_cleaner.rb
pact_broker-2.0.3 spec/support/database_cleaner.rb