Commit af349eb6 authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Peter Leitzen

Fix leaky constant in system check spec

parent 0775c2bd
...@@ -379,7 +379,6 @@ RSpec/LeakyConstantDeclaration: ...@@ -379,7 +379,6 @@ RSpec/LeakyConstantDeclaration:
- 'spec/lib/marginalia_spec.rb' - 'spec/lib/marginalia_spec.rb'
- 'spec/lib/omni_auth/strategies/jwt_spec.rb' - 'spec/lib/omni_auth/strategies/jwt_spec.rb'
- 'spec/lib/system_check/simple_executor_spec.rb' - 'spec/lib/system_check/simple_executor_spec.rb'
- 'spec/lib/system_check_spec.rb'
- 'spec/mailers/notify_spec.rb' - 'spec/mailers/notify_spec.rb'
- 'spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb' - 'spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb'
- 'spec/migrations/encrypt_plaintext_attributes_on_application_settings_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' ...@@ -4,19 +4,22 @@ require 'spec_helper'
require 'rake_helper' require 'rake_helper'
describe SystemCheck do describe SystemCheck do
class SimpleCheck < SystemCheck::BaseCheck before do
stub_const('SimpleCheck', Class.new(SystemCheck::BaseCheck))
stub_const('OtherCheck', Class.new(SystemCheck::BaseCheck))
SimpleCheck.class_eval do
def check? def check?
true true
end end
end end
class OtherCheck < SystemCheck::BaseCheck OtherCheck.class_eval do
def check? def check?
false false
end end
end end
before do
silence_output silence_output
end 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