Cleaning up and writing tests
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
# If you are getting an error `uninitialized constant StringIO` make sure that
|
||||
# your code is in an `it` block.
|
||||
|
||||
# Helper that captures STDOUT.
|
||||
def capture_stdout
|
||||
output = StringIO.new
|
||||
$stdout = output
|
||||
yield
|
||||
output.string
|
||||
ensure
|
||||
$stdout = STDOUT
|
||||
end
|
||||
Reference in New Issue
Block a user