diff options
Diffstat (limited to 'spec/ruby/core/thread/backtrace/location/lineno_spec.rb')
-rw-r--r-- | spec/ruby/core/thread/backtrace/location/lineno_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/ruby/core/thread/backtrace/location/lineno_spec.rb b/spec/ruby/core/thread/backtrace/location/lineno_spec.rb index dc93d32d75..d14cf17514 100644 --- a/spec/ruby/core/thread/backtrace/location/lineno_spec.rb +++ b/spec/ruby/core/thread/backtrace/location/lineno_spec.rb @@ -10,4 +10,14 @@ describe 'Thread::Backtrace::Location#lineno' do it 'returns the absolute path of the call frame' do @frame.lineno.should == @line end + + it 'should be the same line number as in #to_s, including for core methods' do + # Get the caller_locations from a call made into a core library method + locations = [:non_empty].map { caller_locations }[0] + + locations.each do |location| + line_number = location.to_s[/:(\d+):/, 1] + location.lineno.should == Integer(line_number) + end + end end |