1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Fix failures in pry_defaults_spec

This commit is contained in:
Ryan Fitzgerald 2012-12-15 15:26:19 -08:00
parent 04ea66a75c
commit 1fb571f884

View file

@ -75,16 +75,17 @@ describe "test Pry defaults" do
end
it 'should set the output default, and the default should be overridable' do
Pry.input = InputTester.new("5", "6", "7")
Pry.output = @str_output
Pry.input = InputTester.new("5")
Pry.new.rep
@str_output.string.should =~ /5/
Pry.input = InputTester.new("6")
Pry.new.rep
@str_output.string.should =~ /5\n.*6/
Pry.input = InputTester.new("7")
@str_output = StringIO.new
Pry.new(:output => @str_output).rep
@str_output.string.should.not =~ /5\n.*6/
@ -198,12 +199,11 @@ describe "test Pry defaults" do
end
it 'should restore overridden prompts when returning from file-mode' do
pry = Pry.new :input => InputTester.new('shell-mode', 'shell-mode'),
:prompt => [ proc { 'P>' } ] * 2
pry = Pry.new(:prompt => [ proc { 'P>' } ] * 2)
pry.select_prompt(@empty_input_buffer, @context).should == "P>"
pry.re
pry.process_command('shell-mode')
pry.select_prompt(@empty_input_buffer, @context).should =~ /\Apry .* \$ \z/
pry.re
pry.process_command('shell-mode')
pry.select_prompt(@empty_input_buffer, @context).should == "P>"
end