mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Made Pry able to cd into procs
This commit is contained in:
parent
d157c5a4d6
commit
206c79588c
2 changed files with 7 additions and 2 deletions
|
@ -30,13 +30,13 @@ class Object
|
|||
begin
|
||||
instance_eval %{
|
||||
def __binding_impl__
|
||||
binding
|
||||
Kernel.binding
|
||||
end
|
||||
}
|
||||
rescue TypeError
|
||||
self.class.class_eval %{
|
||||
def __binding_impl__
|
||||
binding
|
||||
Kernel.binding
|
||||
end
|
||||
}
|
||||
end
|
||||
|
|
|
@ -294,6 +294,11 @@ describe Pry do
|
|||
Pry.binding_for(_main_.call).should == TOPLEVEL_BINDING
|
||||
Pry.binding_for(_main_.call).should == Pry.binding_for(_main_.call)
|
||||
end
|
||||
|
||||
it 'should return a binding with the right self for procs' do
|
||||
proc = Proc.new {}
|
||||
Pry.binding_for(proc).eval("self").should.equal? proc
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue