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
1 changed files with 11 additions and 0 deletions

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