Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-06-06 21:07:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-06 21:07:33 +0300
commit9e5484cee690f8bb2c1796013345d8cbc1872d77 (patch)
tree7b5c95c7de5eaba5ebb053da65c83184af1cf74c /spec/initializers
parent638e2f1c5f55988135da63c7aa57bcecb9355a2b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/initializers')
-rw-r--r--spec/initializers/00_deprecations_spec.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/spec/initializers/00_deprecations_spec.rb b/spec/initializers/00_deprecations_spec.rb
index a12d079082b..ee415861fe8 100644
--- a/spec/initializers/00_deprecations_spec.rb
+++ b/spec/initializers/00_deprecations_spec.rb
@@ -120,21 +120,27 @@ RSpec.describe '00_deprecations', feature_category: :shared do
subject { ActiveSupport::Deprecation.warn('This is disallowed warning 1.') }
- it 'raises ActiveSupport::DeprecationException' do
- expect { subject }.to raise_error(ActiveSupport::DeprecationException)
+ it 'raises Exception and warns on stderr' do
+ expect { subject }
+ .to raise_error(Exception)
+ .and output(match(/^DEPRECATION WARNING: This is disallowed warning 1\./)).to_stderr
end
context 'when in production environment' do
let(:rails_env) { 'production' }
- it 'does not raise ActiveSupport::DeprecationException' do
+ it_behaves_like 'does not log to stderr'
+
+ it 'does not raise' do
expect { subject }.not_to raise_error
end
context 'when GITLAB_LOG_DEPRECATIONS is set' do
let(:gitlab_log_deprecations) { '1' }
- it 'does not raise ActiveSupport::DeprecationException' do
+ it_behaves_like 'does not log to stderr'
+
+ it 'does not raise' do
expect { subject }.not_to raise_error
end
end