Skip to content

Commit

Permalink
Remove test that's not useful
Browse files Browse the repository at this point in the history
This test was originally added when ActiveSupport::Deprecation was a
Module in 2c690a0. It was testing that
including the module and changing the behavior would not impact the
global deprecation behavior.

When ActiveSupport::Deprecation was changed to be a Class in
71993c6, it started to mutate the
global state, changing the behavior of the singleton. And the test lost
its meaning, it wasn't testing anymore that one Deprecation object
wouldn't impact another.

I didn't add such a test because it's default behavior that changing one
object doesn't impact another.
  • Loading branch information
etiennebarrie committed Feb 15, 2023
1 parent 3ddb970 commit 689bbb4
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions activesupport/test/deprecation_test.rb
Expand Up @@ -411,20 +411,6 @@ def setup
assert_deprecated(/this is the old way/, @deprecator) { klass.new.fubar }
end

test "delegating to ActiveSupport::Deprecation" do
messages = []

klass = Class.new do
delegate :warn, :behavior=, to: ActiveSupport::Deprecation
end

o = klass.new
o.behavior = Proc.new { |message, callstack| messages << message }
assert_difference("messages.size") do
o.warn("warning")
end
end

test "overriding deprecated_method_warning" do
deprecator = deprecator_with_messages

Expand Down

0 comments on commit 689bbb4

Please sign in to comment.