summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-09-21 09:54:08 +1200
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-09-21 11:48:44 +1200
commit70f08f1eed1df4579fef047d28fc3c807183fcfa (patch)
tree75b19e3db5bcb6367f000764bf7f5096fc28e0ed /spec
parent596173155a15b6d4a7b04bdaf9218b3e756a0683 (diff)
Make `Thread#join` non-blocking.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3558
Diffstat (limited to 'spec')
-rw-r--r--spec/ruby/core/thread/join_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/ruby/core/thread/join_spec.rb b/spec/ruby/core/thread/join_spec.rb
index f3c5cdc1ed..6477e17b6e 100644
--- a/spec/ruby/core/thread/join_spec.rb
+++ b/spec/ruby/core/thread/join_spec.rb
@@ -19,8 +19,13 @@ describe "Thread#join" do
t.join(0).should equal(t)
t.join(0.0).should equal(t)
t.join(nil).should equal(t)
+ end
+
+ it "raises TypeError if the argument is not a valid timeout" do
+ t = Thread.new {sleep}
-> { t.join(:foo) }.should raise_error TypeError
-> { t.join("bar") }.should raise_error TypeError
+ t.kill
end
it "returns nil if it is not finished when given a timeout" do