diff options
Diffstat (limited to 'railties/test/abstract_unit.rb')
-rw-r--r-- | railties/test/abstract_unit.rb | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/railties/test/abstract_unit.rb b/railties/test/abstract_unit.rb index d8800eaa0f..0749615d03 100644 --- a/railties/test/abstract_unit.rb +++ b/railties/test/abstract_unit.rb @@ -30,26 +30,24 @@ end class ActiveSupport::TestCase # FIXME: we have tests that depend on run order, we should fix that and # remove this method call. - self.my_tests_are_order_dependent! + self.test_order = :sorted private - unless defined?(:capture) - 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 + 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 |