2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-18 13:06:22 +00:00
|
|
|
|
|
|
|
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
|