aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-01-02 22:08:41 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-01-04 11:58:40 -0300
commit481e49c64f790e46f4aff3ed539ed227d2eb46cb (patch)
tree2554f68cb6760765764799be4cf6fd58212a8686 /railties/test
parent98ea19925d6db642731741c3b91bd085fac92241 (diff)
downloadrails-481e49c64f790e46f4aff3ed539ed227d2eb46cb.tar.gz
rails-481e49c64f790e46f4aff3ed539ed227d2eb46cb.tar.bz2
rails-481e49c64f790e46f4aff3ed539ed227d2eb46cb.zip
Remove deprecated methods at `Kernel`.
`silence_stderr`, `silence_stream`, `capture` and `quietly`.
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/generators/generators_test_helper.rb10
-rw-r--r--railties/test/isolation/abstract_unit.rb10
2 files changed, 20 insertions, 0 deletions
diff --git a/railties/test/generators/generators_test_helper.rb b/railties/test/generators/generators_test_helper.rb
index 6cc91f166b..94099fcd2e 100644
--- a/railties/test/generators/generators_test_helper.rb
+++ b/railties/test/generators/generators_test_helper.rb
@@ -49,4 +49,14 @@ module GeneratorsTestHelper
end
end
end
+
+ def silence_stream(stream)
+ old_stream = stream.dup
+ stream.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null')
+ stream.sync = true
+ yield
+ ensure
+ stream.reopen(old_stream)
+ old_stream.close
+ end
end
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb
index 9ad0ec0d34..39e8a5f756 100644
--- a/railties/test/isolation/abstract_unit.rb
+++ b/railties/test/isolation/abstract_unit.rb
@@ -338,6 +338,16 @@ class ActiveSupport::TestCase
end
end
end
+
+ def silence_stream(stream)
+ old_stream = stream.dup
+ stream.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null')
+ stream.sync = true
+ yield
+ ensure
+ stream.reopen(old_stream)
+ old_stream.close
+ end
end
# Create a scope and build a fixture rails app