mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
cd '../' no longer breaks out of the REPL loop. Closes #403.
Conflicts: test/test_default_commands/test_context.rb
This commit is contained in:
parent
1baf8131a0
commit
d1544d9b8d
2 changed files with 10 additions and 6 deletions
|
@ -24,10 +24,7 @@ class Pry
|
|||
when "."
|
||||
next
|
||||
when ".."
|
||||
if stack.one?
|
||||
_pry_.binding_stack.clear
|
||||
throw(:breakout)
|
||||
else
|
||||
unless stack.size == 1
|
||||
stack.pop
|
||||
end
|
||||
else
|
||||
|
|
|
@ -141,8 +141,15 @@ describe "Pry::DefaultCommands::Context" do
|
|||
$outer.should == :outer
|
||||
end
|
||||
|
||||
it 'should break out of the repl loop of Pry instance when binding_stack has only one binding with cd ..' do
|
||||
Pry.start(0, :input => StringIO.new("cd ..")).should == nil
|
||||
it "should not leave the REPL session when given 'cd ..'" do
|
||||
b = Pry.binding_for(Object.new)
|
||||
input = InputTester.new "cd ..", "$obj = self", "exit-all"
|
||||
|
||||
redirect_pry_io(input, StringIO.new) do
|
||||
b.pry
|
||||
end
|
||||
|
||||
$obj.should == b.eval("self")
|
||||
end
|
||||
|
||||
it 'should break out to outer-most session with cd /' do
|
||||
|
|
Loading…
Add table
Reference in a new issue