aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/thread
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-08-28 20:26:02 +0200
committerBenoit Daloze <eregontp@gmail.com>2020-08-28 20:26:02 +0200
commitb49307c701911a713cbdb48367833d3661a4880a (patch)
tree75674a3f22bee0b347b3efbbcc160bc7a637b8e3 /spec/ruby/core/thread
parent3dd63108b0e7551aba76eba85a459b58ec971ccb (diff)
downloadruby-b49307c701911a713cbdb48367833d3661a4880a.tar.gz
Update to ruby/spec@335eb9b
Diffstat (limited to 'spec/ruby/core/thread')
-rw-r--r--spec/ruby/core/thread/backtrace/location/base_label_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/ruby/core/thread/backtrace/location/base_label_spec.rb b/spec/ruby/core/thread/backtrace/location/base_label_spec.rb
index 139a68e2c8..739f62f42f 100644
--- a/spec/ruby/core/thread/backtrace/location/base_label_spec.rb
+++ b/spec/ruby/core/thread/backtrace/location/base_label_spec.rb
@@ -19,4 +19,31 @@ describe 'Thread::Backtrace::Location#base_label' do
@frame.base_label.should == 'block_location'
end
end
+
+ it "is <module:A> for a module body" do
+ module ThreadBacktraceLocationSpecs
+ module ModuleLabel
+ ScratchPad.record caller_locations(0, 1)[0].base_label
+ end
+ end
+ ScratchPad.recorded.should == '<module:ModuleLabel>'
+ end
+
+ it "is <class:A> for a class body" do
+ module ThreadBacktraceLocationSpecs
+ class ClassLabel
+ ScratchPad.record caller_locations(0, 1)[0].base_label
+ end
+ end
+ ScratchPad.recorded.should == '<class:ClassLabel>'
+ end
+
+ it "is 'singleton class' for a singleton class body" do
+ module ThreadBacktraceLocationSpecs
+ class << Object.new
+ ScratchPad.record caller_locations(0, 1)[0].base_label
+ end
+ end
+ ScratchPad.recorded.should =~ /\A(singleton class|<singleton class>)\z/
+ end
end