diff options
Diffstat (limited to 'activesupport/test/core_ext/kernel_test.rb')
-rw-r--r-- | activesupport/test/core_ext/kernel_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/kernel_test.rb b/activesupport/test/core_ext/kernel_test.rb index e826ec161d..1dfc283268 100644 --- a/activesupport/test/core_ext/kernel_test.rb +++ b/activesupport/test/core_ext/kernel_test.rb @@ -1,4 +1,5 @@ require 'abstract_unit' +require 'active_support/core_ext/kernel' class KernelTest < Test::Unit::TestCase def test_silence_warnings @@ -41,3 +42,18 @@ class KernelTest < Test::Unit::TestCase assert_equal 1, silence_stderr { 1 } end end + +class KernelSupressTest < Test::Unit::TestCase + def test_reraise + assert_raise(LoadError) do + suppress(ArgumentError) { raise LoadError } + end + end + + def test_supression + suppress(ArgumentError) { raise ArgumentError } + suppress(LoadError) { raise LoadError } + suppress(LoadError, ArgumentError) { raise LoadError } + suppress(LoadError, ArgumentError) { raise ArgumentError } + end +end |