From 6e2ca1a1865660088e41cee2cb36f1df56a60dd1 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Thu, 12 Sep 2019 11:21:25 -0400 Subject: [PATCH] Make tests safer Using a class variable here makes the tests susceptible to phantom greens because (depending on the order of the tests), the class variable could have been set by a prior test. (Test polution) Better to have the variable be tied to the instance. --- activesupport/test/concern_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activesupport/test/concern_test.rb b/activesupport/test/concern_test.rb index 40f27ef4e9..28d95514b9 100644 --- a/activesupport/test/concern_test.rb +++ b/activesupport/test/concern_test.rb @@ -13,11 +13,11 @@ class ConcernTest < ActiveSupport::TestCase end def included_ran=(value) - @@included_ran = value + @included_ran = value end def included_ran - @@included_ran + @included_ran end end