From 6998c9373d7dd9658539bcf61472db02193bdbee Mon Sep 17 00:00:00 2001 From: Herwin Date: Thu, 22 Aug 2024 19:29:32 +0200 Subject: [PATCH] Add specs for Thread#group --- core/thread/group_spec.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/core/thread/group_spec.rb b/core/thread/group_spec.rb index 59f5ac37c8..d0d4704b66 100644 --- a/core/thread/group_spec.rb +++ b/core/thread/group_spec.rb @@ -1,5 +1,16 @@ require_relative '../../spec_helper' -require_relative 'fixtures/classes' + describe "Thread#group" do - it "needs to be reviewed for spec completeness" + it "returns the default thread group for the main thread" do + Thread.main.group.should == ThreadGroup::Default + end + + it "returns the thread group explicitly set for this thread" do + thread = Thread.new { nil } + thread_group = ThreadGroup.new + thread_group.add(thread) + thread.group.should == thread_group + ensure + thread.join if thread + end end