Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
56de2a0ec01b
Commit
3dab1f8c
authored
Apr 09, 2018
by
Stan Hu
Browse files
Work around Ruby 2.3.7 bug by defining prepended class methods needed for tests
parent
b34d933c856f
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/workers/authorized_projects_worker.rb
View file @
56de2a0e
...
...
@@ -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 @
56de2a0e
...
...
@@ -14,6 +14,12 @@ class << self
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