Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit d627b9e

Browse files
committed
Restore previous implementation for old Ruby
1 parent 1b8a0d2 commit d627b9e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/rspec/support.rb

+8-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,14 @@ def self.class_of(object)
9999
end
100100

101101
# A single thread local variable so we don't excessively pollute that namespace.
102-
def self.thread_local_data
103-
Thread.__rspec_current_thread.__rspec_local_data ||= {}
102+
if RUBY_VERSION.to_f != 1.9
103+
def self.thread_local_data
104+
Thread.__rspec_current_thread.__rspec_local_data ||= {}
105+
end
106+
else
107+
def self.thread_local_data
108+
Thread.current[:__rspec] ||= {}
109+
end
104110
end
105111

106112
# @api private

0 commit comments

Comments
 (0)