summaryrefslogtreecommitdiff
path: root/spec/ruby/core/thread
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-28 14:22:29 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-28 14:22:29 +0000
commita28aa80c739a1d169649a4da833ef48cfb3465b3 (patch)
treec2f6bb79c268bd60116b54319ea96f01bb7dda79 /spec/ruby/core/thread
parent0f64776745ef31e626dec0d42b7fb2a5988397ec (diff)
Update to ruby/spec@e81b3cd
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/core/thread')
-rw-r--r--spec/ruby/core/thread/list_spec.rb19
1 files changed, 16 insertions, 3 deletions
diff --git a/spec/ruby/core/thread/list_spec.rb b/spec/ruby/core/thread/list_spec.rb
index bd56cb4c52..80dd15c6ca 100644
--- a/spec/ruby/core/thread/list_spec.rb
+++ b/spec/ruby/core/thread/list_spec.rb
@@ -35,8 +35,21 @@ describe "Thread.list" do
t.join
end
end
-end
-describe "Thread.list" do
- it "needs to be reviewed for spec completeness"
+ it "returns instances of Thread and not null or nil values" do
+ spawner = Thread.new do
+ Array.new(100) do
+ Thread.new {}
+ end
+ end
+
+ while spawner.alive?
+ Thread.list.each { |th|
+ th.should be_kind_of(Thread)
+ }
+ end
+
+ threads = spawner.value
+ threads.each(&:join)
+ end
end