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:
- '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