From 8a3bce78c95f0ae27263036612c0f402bad1af26 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 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/thread/group_spec.rb b/core/thread/group_spec.rb index 59f5ac37c8..1fb19fdbc2 100644 --- a/core/thread/group_spec.rb +++ b/core/thread/group_spec.rb @@ -1,5 +1,15 @@ 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 + thread.join + end end