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"]
Show source
Register or log in to add new notes.