diff options
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/kernel_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/kernel_test.rb b/activesupport/test/core_ext/kernel_test.rb index 7d1565157a..e2d89176b9 100644 --- a/activesupport/test/core_ext/kernel_test.rb +++ b/activesupport/test/core_ext/kernel_test.rb @@ -20,4 +20,14 @@ class KernelTest < Test::Unit::TestCase def test_silence_warnings_with_return_value assert_equal 1, silence_warnings { 1 } end + + def test_silence_stderr + old_stderr_position = STDERR.tell + silence_stderr { STDERR.puts 'hello world' } + assert_equal old_stderr_position, STDERR.tell + end + + def test_silence_stderr_with_return_value + assert_equal 1, silence_stderr { 1 } + end end |