Skip to content

Commit eaa6528

Browse files
authored
Merge pull request rails#53212 from davidstosik/sto/test-leaks
Fix test leak due to using class instance variables and inheritance
2 parents 967c33d + 804b51e commit eaa6528

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

railties/test/configuration/dynamic_options_test.rb

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,9 @@
77

88
module RailtiesTest
99
class DynamicOptionsTest < ActiveSupport::TestCase
10-
class Configuration < Rails::Railtie::Configuration
11-
def reset_options
12-
@@options = {}
13-
end
14-
end
15-
1610
setup do
17-
@config = Configuration.new
18-
@config.reset_options
11+
@config = Rails::Railtie::Configuration.dup.new
12+
@config.class.class_variable_set(:@@options, {})
1913
end
2014

2115
test "arbitrary keys can be set, reset, and read" do

0 commit comments

Comments
 (0)