mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@241f9e7
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e59bf54b3a
commit
e87fb88be8
142 changed files with 1165 additions and 1078 deletions
|
@ -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")
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
module ThreadBacktraceLocationSpecs
|
||||
class MethodAddedAbsolutePath
|
||||
def self.method_added(name)
|
||||
ScratchPad.record caller_locations
|
||||
end
|
||||
|
||||
def foo
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue