mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Simplify Thread#[]= spec
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4525cf2cd5
commit
82d63fcaac
1 changed files with 2 additions and 4 deletions
|
@ -7,15 +7,13 @@ describe "Thread#[]=" do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "raises a RuntimeError if the thread is frozen" do
|
it "raises a RuntimeError if the thread is frozen" do
|
||||||
running = false
|
Thread.new do
|
||||||
t = Thread.new do
|
|
||||||
th = Thread.current
|
th = Thread.current
|
||||||
th.freeze
|
th.freeze
|
||||||
-> {
|
-> {
|
||||||
th[:foo] = "bar"
|
th[:foo] = "bar"
|
||||||
}.should raise_error(RuntimeError, /frozen/)
|
}.should raise_error(RuntimeError, /frozen/)
|
||||||
end
|
end.join
|
||||||
t.join
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it "raises exceptions on the wrong type of keys" do
|
it "raises exceptions on the wrong type of keys" do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue