Revert "Add default exceptions affected by suppress (#25099)"

This reverts commit 28492204ee.

Reason: `suppress` without an argument doesn't actually tell what is
supressing. Also, it can be confused with ActiveRecord::Base#suppress.
This commit is contained in:
Rafael Mendonça França 2016-05-23 20:48:43 -03:00
parent 28492204ee
commit 661ed303f4
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
2 changed files with 0 additions and 10 deletions

View File

@ -37,7 +37,6 @@ module Kernel
#
# puts 'This code gets executed and nothing related to ZeroDivisionError was seen'
def suppress(*exception_classes)
exception_classes = StandardError if exception_classes.empty?
yield
rescue *exception_classes
end

View File

@ -42,15 +42,6 @@ class KernelSuppressTest < ActiveSupport::TestCase
end
end
def test_suppress_with_defaults
suppress { raise RuntimeError }
suppress { raise ArgumentError }
assert_raise(LoadError) do
suppress { raise LoadError }
end
end
def test_suppression
suppress(ArgumentError) { raise ArgumentError }
suppress(LoadError) { raise LoadError }