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

Add mock_pry to tests.

This is the most common using for redirect_pry_io.
This commit is contained in:
Conrad Irwin 2011-08-24 00:59:48 -07:00
parent 03a72882f2
commit f8b7260872

View file

@ -46,6 +46,17 @@ def redirect_pry_io(new_in, new_out)
end
end
def mock_pry(*args)
input = InputTester.new(*args)
output = StringIO.new
redirect_pry_io(input, output) do
Pry.start
end
output.string
end
def redirect_global_pry_input(new_io)
old_io = Pry.input
Pry.input = new_io