diff options
author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2020-09-21 09:54:08 +1200 |
---|---|---|
committer | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2020-09-21 11:48:44 +1200 |
commit | 70f08f1eed1df4579fef047d28fc3c807183fcfa (patch) | |
tree | 75b19e3db5bcb6367f000764bf7f5096fc28e0ed /spec | |
parent | 596173155a15b6d4a7b04bdaf9218b3e756a0683 (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.rb | 5 |
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 |