Skip to content

Commit

Permalink
Showing 2 changed files with 3 additions and 13 deletions.
12 changes: 1 addition & 11 deletions kernel/common/thread.rb
Original file line number Diff line number Diff line change
@@ -150,17 +150,7 @@ def initialize(label, absolute_path, lineno)
end

alias_method :base_label, :label

##
# The MRI documentation states this method should return the file name. In
# reality however this method just returns the full path.
#
# Rubinius here sticks to whatever the documentation specifies, thus we
# return only the filename.
#
def path
File.basename(absolute_path)
end
alias_method :path, :absolute_path

def to_s
"#{absolute_path}:#{lineno}:in `#{label}'"
4 changes: 2 additions & 2 deletions spec/ruby/core/thread/backtrace/location/path_spec.rb
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
@frame = ThreadBacktraceLocationSpecs.locations[0]
end

it 'returns the file name of the call frame' do
@frame.path.should == File.basename(__FILE__)
it 'returns the absolute path of the call frame' do
@frame.path.should == __FILE__
end
end

0 comments on commit 217034f

Please sign in to comment.