spec_helper.rb 803 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
Dir[Rails.root.join("ee/spec/support/helpers/*.rb")].each { |f| require f }
Dir[Rails.root.join("ee/spec/support/shared_contexts/*.rb")].each { |f| require f }
Dir[Rails.root.join("ee/spec/support/shared_examples/*.rb")].each { |f| require f }
Dir[Rails.root.join("ee/spec/support/**/*.rb")].each { |f| require f }

RSpec.configure do |config|
  config.include EE::LicenseHelpers

  config.before(:all) do
10
    License.destroy_all # rubocop: disable DestroyAll
11 12 13 14 15 16 17 18 19 20
    TestLicense.init
  end

  config.around(:each, :geo) do |example|
    example.run if Gitlab::Database.postgresql?
  end

  config.around(:each, :geo_tracking_db) do |example|
    example.run if Gitlab::Geo.geo_database_configured?
  end
21 22 23 24

  config.around(:each, :geo_fdw) do |example|
    example.run if Gitlab::Geo::Fdw.enabled?
  end
25
end