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
517ee9fd
Commit
517ee9fd
authored
Aug 30, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Override. Properly define prepended
We should never be sloppy!
parent
71fefe14
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
lib/gitlab/utils/override.rb
lib/gitlab/utils/override.rb
+6
-2
spec/lib/gitlab/patch/prependable_spec.rb
spec/lib/gitlab/patch/prependable_spec.rb
+5
-5
No files found.
lib/gitlab/utils/override.rb
View file @
517ee9fd
...
...
@@ -92,9 +92,13 @@ module Gitlab
queue_verification
(
base
)
end
alias_method
:prepended
,
:included
def
prepended
(
base
=
nil
)
super
queue_verification
(
base
)
end
def
extended
(
mod
)
def
extended
(
mod
=
nil
)
super
queue_verification
(
mod
.
singleton_class
)
...
...
spec/lib/gitlab/patch/prependable_spec.rb
View file @
517ee9fd
...
...
@@ -23,7 +23,7 @@ describe Gitlab::Patch::Prependable do
this
=
self
prepended
do
prepended_modules_
<<
this
prepended_modules_
<<
[
self
,
this
]
end
def
name
...
...
@@ -48,7 +48,7 @@ describe Gitlab::Patch::Prependable do
this
=
self
prepended
do
prepended_modules_
<<
this
prepended_modules_
<<
[
self
,
this
]
end
def
name
...
...
@@ -71,7 +71,7 @@ describe Gitlab::Patch::Prependable do
subject
expect
(
prepended_modules
).
to
eq
([
ee
,
ce
])
expect
(
prepended_modules
).
to
eq
([
[
subject
,
ee
],
[
subject
,
ce
]
])
end
end
...
...
@@ -86,7 +86,7 @@ describe Gitlab::Patch::Prependable do
it
'prepends only once'
do
subject
.
prepend
(
ce
)
expect
(
prepended_modules
).
to
eq
([
ee
,
ce
])
expect
(
prepended_modules
).
to
eq
([
[
subject
,
ee
],
[
subject
,
ce
]
])
end
end
...
...
@@ -115,7 +115,7 @@ describe Gitlab::Patch::Prependable do
it
'prepends only once'
do
subject
.
prepend
(
ee
)
expect
(
prepended_modules
).
to
eq
([
ee
])
expect
(
prepended_modules
).
to
eq
([
[
subject
,
ee
]
])
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