Last active
December 30, 2015 05:08
-
-
Save palexander/7780135 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -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