1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2018-09-25 10:41:16 +00:00
parent e59bf54b3a
commit e87fb88be8
142 changed files with 1165 additions and 1078 deletions

View file

@ -18,6 +18,17 @@ describe 'Thread::Backtrace::Location#absolute_path' do
end
end
context "when used in #method_added" do
it "returns the user filename that defined the method" do
path = fixture(__FILE__, "absolute_path_method_added.rb")
load path
locations = ScratchPad.recorded
locations[0].absolute_path.should == path
# Make sure it's from the class body, not from the file top-level
locations[0].label.should include 'MethodAddedAbsolutePath'
end
end
platform_is_not :windows do
before :each do
@file = fixture(__FILE__, "absolute_path.rb")

View file

@ -0,0 +1,10 @@
module ThreadBacktraceLocationSpecs
class MethodAddedAbsolutePath
def self.method_added(name)
ScratchPad.record caller_locations
end
def foo
end
end
end