Merge pull request #47200 from skipkayhil/use-ad-deprecator-illegal-state

Use AD.deprecator for IllegalStateError
This commit is contained in:
Eileen M. Uchitelle 2023-01-31 08:48:59 -05:00 committed by GitHub
commit 3cca0d5205
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

@ -36,11 +36,14 @@ module Rack
end
module ActionDispatch
include ActiveSupport::Deprecation::DeprecatedConstantAccessor
extend ActiveSupport::Autoload
class IllegalStateError < StandardError
class DeprecatedIllegalStateError < StandardError
end
deprecate_constant :IllegalStateError
deprecate_constant "IllegalStateError", "ActionDispatch::DeprecatedIllegalStateError",
message: "ActionDispatch::IllegalStateError is deprecated without replacement.",
deprecator: ActionDispatch.deprecator
class MissingController < NameError
end

@ -10,6 +10,12 @@ def setup
@response.request = ActionDispatch::Request.empty
end
def test_illegal_state_error_is_deprecated
assert_deprecated(ActionDispatch.deprecator) do
ActionDispatch::IllegalStateError
end
end
def test_can_wait_until_commit
t = Thread.new {
@response.await_commit