vendor/bundle/ruby/2.7.0/gems/dnsruby-1.61.5/test/test_utils.rb
# Asserts that all exceptions whose type are the specified exception class
# or one of its subclasses are *not* raised.
#
# If any other kind of exception is raised, the test throws an exception
# (rather than failing).
#
# The test passes if and only if no exceptions are raised.
Asserts that all exceptions whose type are the specified exception class
or one of its subclasses are *not* raised.

If any other kind of exception is raised, the test throws an exception
(rather than failing).

The test passes if and only if no exceptions are raised.
Asserts that all exceptions whose type are the specified exception class or one of its subclasses are * not * raised . If any other kind of exception is raised the test throws an exception ( rather than failing ) . The test passes if and only if no exceptions are raised .
def assert_not_raised(exception_class, failure_message = nil)
      begin
        yield
      rescue => e
        if e.is_a?(exception_class)
          flunk(failure_message || "An exception was not expected but was raised: #{e}")
        else
          raise e
        end
      end
    end
def assert_not_raised ( exception_class , failure_message = nil ) begin yield rescue => e if e . is_a? ( exception_class ) flunk ( failure_message || "An exception was not expected but was raised: #{e}" ) else raise e end end end
Asserts that all exceptions whose type are the specified exception class
or one of its subclasses are *not* raised.
Asserts that all exceptions whose type are the specified exception class or one of its subclasses are * not * raised .
exception_class
<not_specific>
failure_message
<not_specific>