Skip to content

Commit

Permalink
Restore previous implementation for old Ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
JonRowe committed Nov 15, 2024
1 parent 1b8a0d2 commit d627b9e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/rspec/support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,14 @@ def self.class_of(object)
end

# A single thread local variable so we don't excessively pollute that namespace.
def self.thread_local_data
Thread.__rspec_current_thread.__rspec_local_data ||= {}
if RUBY_VERSION.to_f != 1.9
def self.thread_local_data
Thread.__rspec_current_thread.__rspec_local_data ||= {}
end
else
def self.thread_local_data
Thread.current[:__rspec] ||= {}
end
end

# @api private
Expand Down

0 comments on commit d627b9e

Please sign in to comment.