Skip to content

Commit

Permalink
Add specs for Thread#group
Browse files Browse the repository at this point in the history
  • Loading branch information
herwinw committed Sep 18, 2024
1 parent fcc0e7e commit 6998c93
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions core/thread/group_spec.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6998c93

Please sign in to comment.