diff options
Diffstat (limited to 'spec/ruby/core/thread/backtrace/location/label_spec.rb')
-rw-r--r-- | spec/ruby/core/thread/backtrace/location/label_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/ruby/core/thread/backtrace/location/label_spec.rb b/spec/ruby/core/thread/backtrace/location/label_spec.rb index 7312d017e5..85ddccc8e3 100644 --- a/spec/ruby/core/thread/backtrace/location/label_spec.rb +++ b/spec/ruby/core/thread/backtrace/location/label_spec.rb @@ -7,11 +7,11 @@ describe 'Thread::Backtrace::Location#label' do end it 'returns the method name for a method location' do - ThreadBacktraceLocationSpecs.method_location[0].label.should == "method_location" + ThreadBacktraceLocationSpecs.method_location[0].label.should =~ /\A(?:ThreadBacktraceLocationSpecs\.)?method_location\z/ end it 'returns the block name for a block location' do - ThreadBacktraceLocationSpecs.block_location[0].label.should == "block in block_location" + ThreadBacktraceLocationSpecs.block_location[0].label.should =~ /\Ablock in (?:ThreadBacktraceLocationSpecs\.)?block_location\z/ end it 'returns the module name for a module location' do @@ -22,9 +22,9 @@ describe 'Thread::Backtrace::Location#label' do first_level_location, second_level_location, third_level_location = ThreadBacktraceLocationSpecs.locations_inside_nested_blocks - first_level_location.label.should == 'block in locations_inside_nested_blocks' - second_level_location.label.should == 'block (2 levels) in locations_inside_nested_blocks' - third_level_location.label.should == 'block (3 levels) in locations_inside_nested_blocks' + first_level_location.label.should =~ /\Ablock in (?:ThreadBacktraceLocationSpecs\.)?locations_inside_nested_blocks\z/ + second_level_location.label.should =~ /\Ablock \(2 levels\) in (?:ThreadBacktraceLocationSpecs\.)?locations_inside_nested_blocks\z/ + third_level_location.label.should =~ /\Ablock \(3 levels\) in (?:ThreadBacktraceLocationSpecs\.)?locations_inside_nested_blocks\z/ end it 'sets the location label for a top-level block differently depending on it being in the main file or a required file' do |