diff --git a/spec/ruby/core/thread/element_set_spec.rb b/spec/ruby/core/thread/element_set_spec.rb index b76078f685..fe993df95d 100644 --- a/spec/ruby/core/thread/element_set_spec.rb +++ b/spec/ruby/core/thread/element_set_spec.rb @@ -9,9 +9,10 @@ describe "Thread#[]=" do it "raises a RuntimeError if the thread is frozen" do running = false t = Thread.new do - t.freeze + th = Thread.current + th.freeze -> { - t[:foo] = "bar" + th[:foo] = "bar" }.should raise_error(RuntimeError, /frozen/) end t.join