1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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.
This commit is contained in:
Jason Karns 2019-09-12 11:21:25 -04:00 committed by Kasper Timm Hansen
parent 8543974afa
commit 6e2ca1a186
No known key found for this signature in database
GPG key ID: 191153215EDA53D8

View file

@ -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