Skip to content

Commit

Permalink
Workaround for: ThreadError: already initialized with Ruby 2.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
itmammoth committed Jul 24, 2019
1 parent 6f65af5 commit 655b787
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,20 @@
# --seed 1234
config.order = "random"
end

# Workaround for ThreadError: already initialized with Ruby 2.6.0
# See https://github.com/rails/rails/issues/34790
if RUBY_VERSION >= '2.6.0'
if Rails.version < '5'
class ActionController::TestResponse < ActionDispatch::TestResponse
def recycle!
# hack to avoid MonitorMixin double-initialize error:
@mon_mutex_owner_object_id = nil
@mon_mutex = nil
initialize
end
end
else
puts "Monkeypatch for ActionController::TestResponse no longer needed"
end
end

0 comments on commit 655b787

Please sign in to comment.