aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-07-15 17:56:27 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-07-15 17:56:27 -0300
commit3121412cf181388f8dac71f2d707be2cbb764524 (patch)
tree5e0389e9c50d446a0c5dbcf384a6176bd2fe4934 /activerecord/test
parentaf2ffa8c79e69f99f6eec0aac76737a050bbd06e (diff)
downloadrails-3121412cf181388f8dac71f2d707be2cbb764524.tar.gz
rails-3121412cf181388f8dac71f2d707be2cbb764524.tar.bz2
rails-3121412cf181388f8dac71f2d707be2cbb764524.zip
Keep quietly and capture undeprecated on your suite
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/migration_test.rb10
-rw-r--r--activerecord/test/cases/tasks/mysql_rake_test.rb19
2 files changed, 29 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb
index 6b840e16bb..84720585f2 100644
--- a/activerecord/test/cases/migration_test.rb
+++ b/activerecord/test/cases/migration_test.rb
@@ -895,4 +895,14 @@ class CopyMigrationsTest < ActiveRecord::TestCase
ensure
ActiveRecord::Base.logger = old
end
+
+ private
+
+ def quietly
+ silence_stream(STDOUT) do
+ silence_stream(STDERR) do
+ yield
+ end
+ end
+ end
end
diff --git a/activerecord/test/cases/tasks/mysql_rake_test.rb b/activerecord/test/cases/tasks/mysql_rake_test.rb
index 3e3a2828f3..572ad2ed18 100644
--- a/activerecord/test/cases/tasks/mysql_rake_test.rb
+++ b/activerecord/test/cases/tasks/mysql_rake_test.rb
@@ -288,6 +288,25 @@ module ActiveRecord
@configuration.merge('port' => 10000),
filename)
end
+
+ 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
class MySQLStructureLoadTest < ActiveRecord::TestCase