2021-06-18 13:06:22 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
|
|
|
RSpec.configure do |config|
|
|
|
|
|
|
|
|
config.around(:each, :required_envs) do |example|
|
|
|
|
example.metadata[:required_envs].each do |secret|
|
|
|
|
if ENV[secret].blank?
|
2021-07-01 11:23:52 +00:00
|
|
|
raise "This test requires the ENV variables [#{example.metadata[:required_envs].join(', ')}], but #{secret} was not found."
|
2021-06-18 13:06:22 +00:00
|
|
|
end
|
|
|
|
end
|
2021-07-01 11:23:52 +00:00
|
|
|
|
|
|
|
VCR.configure do |c|
|
|
|
|
example.metadata[:required_envs].each do |env_key|
|
|
|
|
c.filter_sensitive_data("<#{env_key}>") { ENV[env_key] }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-06-18 13:06:22 +00:00
|
|
|
example.run
|
|
|
|
end
|
|
|
|
end
|