diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-20 23:49:30 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-20 23:49:30 +0000 |
commit | 566efc55bcfd9f3d4d3ab22e4217d688a08244bf (patch) | |
tree | 39e854c48b29b776dd29001ab8eb8686745a3ba1 /spec | |
parent | f383d41c63a4c25c2564895389189dd69ccef73c (diff) | |
download | ruby-566efc55bcfd9f3d4d3ab22e4217d688a08244bf.tar.gz |
fix threading bug.
* spec/ruby/core/thread/element_set_spec.rb: `t` can be uninitialized.
Use `Thread.current` explicitly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec')
-rw-r--r-- | spec/ruby/core/thread/element_set_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
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 |