HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-2.7.4/spec/ruby/core/thread/backtrace/location/base_label_spec.rb
require_relative '../../../../spec_helper'
require_relative 'fixtures/classes'

describe 'Thread::Backtrace::Location#base_label' do
  before :each do
    @frame = ThreadBacktraceLocationSpecs.locations[0]
  end

  it 'returns the base label of the call frame' do
    @frame.base_label.should == '<top (required)>'
  end

  describe 'when call frame is inside a block' do
    before :each do
      @frame = ThreadBacktraceLocationSpecs.block_location[0]
    end

    it 'returns the name of the method that contains the block' do
      @frame.base_label.should == 'block_location'
    end
  end
end