Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
20697045
Commit
20697045
authored
May 19, 2020
by
Rajendra Kadam
Committed by
Peter Leitzen
May 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix leaky constant in simple executor spec
parent
42fce179
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
66 deletions
+80
-66
.rubocop.yml
.rubocop.yml
+0
-1
changelogs/unreleased/leaky-constant-fix-24.yml
changelogs/unreleased/leaky-constant-fix-24.yml
+5
-0
spec/lib/system_check/simple_executor_spec.rb
spec/lib/system_check/simple_executor_spec.rb
+75
-65
No files found.
.rubocop.yml
View file @
20697045
...
@@ -372,7 +372,6 @@ RSpec/LeakyConstantDeclaration:
...
@@ -372,7 +372,6 @@ RSpec/LeakyConstantDeclaration:
-
'
spec/lib/gitlab/sidekiq_middleware/server_metrics_spec.rb'
-
'
spec/lib/gitlab/sidekiq_middleware/server_metrics_spec.rb'
-
'
spec/lib/gitlab/view/presenter/factory_spec.rb'
-
'
spec/lib/gitlab/view/presenter/factory_spec.rb'
-
'
spec/lib/marginalia_spec.rb'
-
'
spec/lib/marginalia_spec.rb'
-
'
spec/lib/system_check/simple_executor_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'
...
...
changelogs/unreleased/leaky-constant-fix-24.yml
0 → 100644
View file @
20697045
---
title
:
Fix leaky constant issue in simple executor spec
merge_request
:
32082
author
:
Rajendra Kadam
type
:
fixed
spec/lib/system_check/simple_executor_spec.rb
View file @
20697045
...
@@ -4,99 +4,109 @@ require 'spec_helper'
...
@@ -4,99 +4,109 @@ require 'spec_helper'
require
'rake_helper'
require
'rake_helper'
describe
SystemCheck
::
SimpleExecutor
do
describe
SystemCheck
::
SimpleExecutor
do
class
SimpleCheck
<
SystemCheck
::
BaseCheck
before
do
set_name
'my simple check'
stub_const
(
'SimpleCheck'
,
Class
.
new
(
SystemCheck
::
BaseCheck
))
stub_const
(
'OtherCheck'
,
Class
.
new
(
SystemCheck
::
BaseCheck
))
def
check?
stub_const
(
'SkipCheck'
,
Class
.
new
(
SystemCheck
::
BaseCheck
))
true
stub_const
(
'DynamicSkipCheck'
,
Class
.
new
(
SystemCheck
::
BaseCheck
))
stub_const
(
'MultiCheck'
,
Class
.
new
(
SystemCheck
::
BaseCheck
))
stub_const
(
'SkipMultiCheck'
,
Class
.
new
(
SystemCheck
::
BaseCheck
))
stub_const
(
'RepairCheck'
,
Class
.
new
(
SystemCheck
::
BaseCheck
))
stub_const
(
'BugousCheck'
,
Class
.
new
(
SystemCheck
::
BaseCheck
))
SimpleCheck
.
class_eval
do
set_name
'my simple check'
def
check?
true
end
end
end
end
class
OtherCheck
<
SystemCheck
::
BaseCheck
OtherCheck
.
class_eval
do
set_name
'other check'
set_name
'other check'
def
check?
def
check?
false
false
end
end
def
show_error
def
show_error
$stdout
.
puts
'this is an error text'
$stdout
.
puts
'this is an error text'
end
end
end
end
class
SkipCheck
<
SystemCheck
::
BaseCheck
SkipCheck
.
class_eval
do
set_name
'skip check'
set_name
'skip check'
set_skip_reason
'this is a skip reason'
set_skip_reason
'this is a skip reason'
def
skip?
def
skip?
true
true
end
end
def
check?
def
check?
raise
'should not execute this'
raise
'should not execute this'
end
end
end
end
class
DynamicSkipCheck
<
SystemCheck
::
BaseCheck
DynamicSkipCheck
.
class_eval
do
set_name
'dynamic skip check'
set_name
'dynamic skip check'
set_skip_reason
'this is a skip reason'
set_skip_reason
'this is a skip reason'
def
skip?
def
skip?
self
.
skip_reason
=
'this is a dynamic skip reason'
self
.
skip_reason
=
'this is a dynamic skip reason'
true
true
end
end
def
check?
def
check?
raise
'should not execute this'
raise
'should not execute this'
end
end
end
end
class
MultiCheck
<
SystemCheck
::
BaseCheck
MultiCheck
.
class_eval
do
set_name
'multi check'
set_name
'multi check'
def
multi_check
def
multi_check
$stdout
.
puts
'this is a multi output check'
$stdout
.
puts
'this is a multi output check'
end
end
def
check?
def
check?
raise
'should not execute this'
raise
'should not execute this'
end
end
end
end
class
SkipMultiCheck
<
SystemCheck
::
BaseCheck
SkipMultiCheck
.
class_eval
do
set_name
'skip multi check'
set_name
'skip multi check'
def
skip?
def
skip?
true
true
end
end
def
multi_check
def
multi_check
raise
'should not execute this'
raise
'should not execute this'
end
end
end
end
class
RepairCheck
<
SystemCheck
::
BaseCheck
RepairCheck
.
class_eval
do
set_name
'repair check'
set_name
'repair check'
def
check?
def
check?
false
false
end
end
def
repair!
def
repair!
true
true
end
end
def
show_error
def
show_error
$stdout
.
puts
'this is an error message'
$stdout
.
puts
'this is an error message'
end
end
end
end
class
BugousCheck
<
SystemCheck
::
BaseCheck
BugousCheck
.
class_eval
do
CustomError
=
Class
.
new
(
StandardError
)
set_name
'my bugous check'
set_name
'my bugous check'
def
check?
def
check?
raise
CustomError
,
'omg'
raise
StandardError
,
'omg'
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment