method
collect_deprecations
v7.0.0 -
Show latest stable
- Class:
ActiveSupport::Testing::Deprecation
collect_deprecations(deprecator = nil)public
Returns an array of all the deprecation warnings emitted by the given deprecator during the execution of the yielded block.
collect_deprecations(CustomDeprecator) do CustomDeprecator.warn "message" end # => ["message"]
If no deprecator is given, defaults to ActiveSupport::Deprecation.
collect_deprecations do CustomDeprecator.warn "custom message" ActiveSupport::Deprecation.warn "message" end # => ["message"]