module StructuredWarnings::ClassMethods
If you require 'test/unit'
after structured_warnings
you have to require 'structured_warnings/test'
manually, otherwise the test extensions will be added automatically.
Public Instance Methods
Source
# File lib/structured_warnings.rb, line 25 def warner Dynamic[:warner] end
Gives access to the currently used warner. Default is an instance of StructuredWarnings::Warner
Source
# File lib/structured_warnings.rb, line 17 def with_warner(warner) Dynamic.let(:warner => warner) do yield end end
Executes a block using the given warner. This may be used to suppress warnings to stdout, but fetch them and redirect them to somewhere else.
This behaviour is used in the StructuredWarnings::Assertions