Skip to content

Commit

Permalink
Merge pull request #1192 from herwinw/thread_group
Browse files Browse the repository at this point in the history
Add specs for Thread#group
  • Loading branch information
andrykonchin committed Sep 19, 2024
2 parents fcc0e7e + 6998c93 commit 95f602a
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 95f602a

Please sign in to comment.