mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
return nil by default on session exit (fix #326)
This commit is contained in:
parent
bf4fda4bba
commit
d3424543d8
3 changed files with 7 additions and 7 deletions
|
@ -189,7 +189,7 @@ class Pry
|
|||
end
|
||||
|
||||
repl_epilogue(target)
|
||||
break_data || target_self
|
||||
break_data || nil
|
||||
end
|
||||
|
||||
# Perform a read-eval-print.
|
||||
|
|
|
@ -2,9 +2,9 @@ require 'helper'
|
|||
|
||||
describe "Pry::DefaultCommands::Context" do
|
||||
describe "exit-all" do
|
||||
it 'should break out of the repl loop of Pry instance (returning target of session)' do
|
||||
it 'should break out of the repl loop of Pry instance and return nil' do
|
||||
redirect_pry_io(InputTester.new("exit-all"), StringIO.new) do
|
||||
Pry.new.repl(0).should == 0
|
||||
Pry.new.repl(0).should == nil
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -44,7 +44,7 @@ describe "Pry::DefaultCommands::Context" do
|
|||
end
|
||||
|
||||
it 'should break out of the repl loop of Pry instance when binding_stack has only one binding with exit' do
|
||||
Pry.start(0, :input => StringIO.new("exit")).should == 0
|
||||
Pry.start(0, :input => StringIO.new("exit")).should == nil
|
||||
end
|
||||
|
||||
it 'should break out of the repl loop of Pry instance when binding_stack has only one binding with exit, and return user-given value' do
|
||||
|
@ -127,7 +127,7 @@ describe "Pry::DefaultCommands::Context" do
|
|||
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 == 0
|
||||
Pry.start(0, :input => StringIO.new("cd ..")).should == nil
|
||||
end
|
||||
|
||||
it 'should break out to outer-most session with cd /' do
|
||||
|
|
|
@ -1062,8 +1062,8 @@ describe Pry do
|
|||
end
|
||||
|
||||
describe "pry return values" do
|
||||
it 'should return the target object' do
|
||||
Pry.start(self, :input => StringIO.new("exit-all"), :output => Pry::NullOutput).should == self
|
||||
it 'should return nil' do
|
||||
Pry.start(self, :input => StringIO.new("exit-all"), :output => Pry::NullOutput).should == nil
|
||||
end
|
||||
|
||||
it 'should return the parameter given to exit-all' do
|
||||
|
|
Loading…
Add table
Reference in a new issue