Commit 1e030be7 authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'leaky-constant-fix-23' into 'master'

Fix leaky constant in system check spec

See merge request gitlab-org/gitlab!32080
parents 38352a4a af349eb6
......@@ -374,7 +374,6 @@ RSpec/LeakyConstantDeclaration:
- 'spec/lib/marginalia_spec.rb'
- 'spec/lib/omni_auth/strategies/jwt_spec.rb'
- 'spec/lib/system_check/simple_executor_spec.rb'
- 'spec/lib/system_check_spec.rb'
- 'spec/mailers/notify_spec.rb'
- 'spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb'
- 'spec/migrations/encrypt_plaintext_attributes_on_application_settings_spec.rb'
......
---
title: Fix leaky constant issue in system check spec
merge_request: 32080
author: Rajendra Kadam
type: fixed
......@@ -4,19 +4,22 @@ require 'spec_helper'
require 'rake_helper'
describe SystemCheck do
class SimpleCheck < SystemCheck::BaseCheck
def check?
true
before do
stub_const('SimpleCheck', Class.new(SystemCheck::BaseCheck))
stub_const('OtherCheck', Class.new(SystemCheck::BaseCheck))
SimpleCheck.class_eval do
def check?
true
end
end
end
class OtherCheck < SystemCheck::BaseCheck
def check?
false
OtherCheck.class_eval do
def check?
false
end
end
end
before do
silence_output
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment