assert_not_deprecated(deprecator = nil, &block) public

Asserts that no deprecation warnings are emitted by the given deprecator during the execution of the yielded block.

assert_not_deprecated(CustomDeprecator) do
  CustomDeprecator.warn "message" # fails assertion
end

If no deprecator is given, defaults to ActiveSupport::Deprecation.

assert_not_deprecated do
  ActiveSupport::Deprecation.warn "message" # fails assertion
end

assert_not_deprecated do
  CustomDeprecator.warn "message" # passes assertion
end
Show source
Register or log in to add new notes.