method
assert_deprecated
v5.2.3 -
Show latest stable
- Class:
ActiveSupport::Testing::Deprecation
assert_deprecated(match = nil, deprecator = nil, &block)public
No documentation available.
# File activesupport/lib/active_support/testing/deprecation.rb, line 9
def assert_deprecated(match = nil, deprecator = nil, &block)
result, warnings = collect_deprecations(deprecator, &block)
assert !warnings.empty?, "Expected a deprecation warning within the block but received none"
if match
match = Regexp.new(Regexp.escape(match)) unless match.is_a?(Regexp)
assert warnings.any? { |w| match.match?(w) }, "No deprecation warning matched #{match}: #{warnings.join(', ')}"
end
result
end