module ActiveSupport::Testing::Deprecation

def assert_deprecated(match = nil, deprecator = nil, &block)

:nodoc:
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