aboutsummaryrefslogtreecommitdiffstats
path: root/spec/rubyspec/core/thread/status_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubyspec/core/thread/status_spec.rb')
-rw-r--r--spec/rubyspec/core/thread/status_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/rubyspec/core/thread/status_spec.rb b/spec/rubyspec/core/thread/status_spec.rb
index 3fbc4f888a..6cfdf0be40 100644
--- a/spec/rubyspec/core/thread/status_spec.rb
+++ b/spec/rubyspec/core/thread/status_spec.rb
@@ -41,4 +41,20 @@ describe "Thread#status" do
it "reports aborting on a killed thread after sleep" do
ThreadSpecs.status_of_dying_thread_after_sleep.status.should == 'aborting'
end
+
+ it "reports aborting on an externally killed thread that sleeps" do
+ q = Queue.new
+ t = Thread.new do
+ begin
+ q.push nil
+ sleep
+ ensure
+ q.push Thread.current.status
+ end
+ end
+ q.pop
+ t.kill
+ t.join
+ q.pop.should == 'aborting'
+ end
end