1
0
Fork 0
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:
Mon ouïe 2011-05-29 23:55:27 +02:00
parent d157c5a4d6
commit 206c79588c
2 changed files with 7 additions and 2 deletions

View file

@ -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

View file

@ -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