diff options
Diffstat (limited to 'spec/ruby/core/thread/group_spec.rb')
| -rw-r--r-- | spec/ruby/core/thread/group_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/ruby/core/thread/group_spec.rb b/spec/ruby/core/thread/group_spec.rb new file mode 100644 index 0000000000..d0d4704b66 --- /dev/null +++ b/spec/ruby/core/thread/group_spec.rb @@ -0,0 +1,16 @@ +require_relative '../../spec_helper' + +describe "Thread#group" do + 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 |
