BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
63cadbe1
Commit
63cadbe1
authored
Apr 09, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work around Ruby 2.3.7 bug by defining prepended class methods needed for tests
parent
13c6d6ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
authorized_projects_worker.rb
app/workers/authorized_projects_worker.rb
+8
-0
waitable_worker_spec.rb
spec/workers/concerns/waitable_worker_spec.rb
+6
-0
No files found.
app/workers/authorized_projects_worker.rb
View file @
63cadbe1
...
...
@@ -2,6 +2,14 @@ class AuthorizedProjectsWorker
include
ApplicationWorker
prepend
WaitableWorker
# This is a workaround for a Ruby 2.3.7 bug. rspec-mocks cannot restore the
# visibility of prepended modules. See https://github.com/rspec/rspec-mocks/issues/1231
# for more details.
if
Rails
.
env
.
test?
def
self
.
bulk_perform_and_wait
(
args_list
,
timeout:
10
)
end
end
def
perform
(
user_id
)
user
=
User
.
find_by
(
id:
user_id
)
...
...
spec/workers/concerns/waitable_worker_spec.rb
View file @
63cadbe1
...
...
@@ -14,6 +14,12 @@ describe WaitableWorker do
include
ApplicationWorker
prepend
WaitableWorker
# This is a workaround for a Ruby 2.3.7 bug. rspec-mocks cannot restore
# the visibility of prepended modules. See
# https://github.com/rspec/rspec-mocks/issues/1231 for more details.
def
self
.
bulk_perform_inline
(
args_list
)
end
def
perform
(
i
=
0
)
self
.
class
.
counter
+=
i
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