diff options
Diffstat (limited to 'railties/test/abstract_unit.rb')
-rw-r--r-- | railties/test/abstract_unit.rb | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/railties/test/abstract_unit.rb b/railties/test/abstract_unit.rb index 0749615d03..ab8883e135 100644 --- a/railties/test/abstract_unit.rb +++ b/railties/test/abstract_unit.rb @@ -4,6 +4,7 @@ require File.expand_path("../../../load_paths", __FILE__) require 'stringio' require 'active_support/testing/autorun' +require 'active_support/testing/stream' require 'fileutils' require 'active_support' @@ -28,26 +29,10 @@ def jruby_skip(message = '') end class ActiveSupport::TestCase + include ActiveSupport::Testing::Stream + # FIXME: we have tests that depend on run order, we should fix that and # remove this method call. self.test_order = :sorted - private - - def capture(stream) - stream = stream.to_s - captured_stream = Tempfile.new(stream) - stream_io = eval("$#{stream}") - origin_stream = stream_io.dup - stream_io.reopen(captured_stream) - - yield - - stream_io.rewind - return captured_stream.read - ensure - captured_stream.close - captured_stream.unlink - stream_io.reopen(origin_stream) - end end |