Skip to content
代码片段 群组 项目
提交 63cadbe1 编辑于 作者: Stan Hu's avatar Stan Hu
浏览文件

Work around Ruby 2.3.7 bug by defining prepended class methods needed for tests

上级 13c6d6ea
No related branches found
No related tags found
无相关合并请求
......@@ -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)
......
......@@ -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
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册