Skip to content

Instantly share code, notes, and snippets.

@palexander
Last active December 30, 2015 05:08
Show Gist options
  • Save palexander/7780135 to your computer and use it in GitHub Desktop.
Save palexander/7780135 to your computer and use it in GitHub Desktop.
@@ -41,10 +41,23 @@ namespace :docker do
# Require the test files for this particular fork
test_files_sliced[i].each {|f| require_relative f}
+ # redirect stdout
+ require 'stringio'
+ sio = StringIO.new
+ $stdout = sio
+ $stderr = sio
+
# Run the tests
MiniTest::Unit.runner.run
- puts "Fork #{i} testing #{test_files_sliced[i].join(", ")}"
+ # reset stdout
+ $stdout = STDOUT
+ sio.rewind
+
+ # Output the test results
+ puts "Fork #{i} completed, output:"
+ puts "Testing:\n#{test_files_sliced[i].join(", ")}\n"
+ puts sio.read
# Force the fork to end without running at_exit bindings
Kernel.exit!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment