2012-12-15 17:09:16 -05:00
|
|
|
require 'helper'
|
|
|
|
|
|
|
|
describe "The REPL" do
|
|
|
|
before do
|
|
|
|
Pry.config.auto_indent = true
|
|
|
|
end
|
|
|
|
|
|
|
|
after do
|
|
|
|
Pry.config.auto_indent = false
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should let you run commands in the middle of multiline expressions" do
|
|
|
|
mock_pry("def a", "!", "5").should =~ /Input buffer cleared/
|
|
|
|
end
|
2012-12-23 03:03:29 -05:00
|
|
|
|
|
|
|
it "shouldn't break if we start a nested session" do
|
|
|
|
ReplTester.start do |t|
|
2012-12-23 03:08:40 -05:00
|
|
|
t.in 'Pry::REPL.new(_pry_, :target => 10).start'
|
2012-12-23 03:03:29 -05:00
|
|
|
t.out ''
|
|
|
|
t.prompt /10.*> $/
|
|
|
|
|
|
|
|
t.in 'self'
|
|
|
|
t.out '=> 10'
|
|
|
|
|
|
|
|
t.in nil
|
|
|
|
t.out ''
|
|
|
|
|
|
|
|
t.in 'self'
|
|
|
|
t.out '=> main'
|
|
|
|
end
|
|
|
|
end
|
2012-12-15 17:09:16 -05:00
|
|
|
end
|