Skip to content

Commit 883cdb4

Browse files
committed
WIP: fix FrozenError: can't modify frozen Array in CI
1 parent f4766ee commit 883cdb4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

spec/spec_helper.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,19 @@
1010
end
1111

1212
require 'engine_cart'
13+
1314
EngineCart.load_application!
1415

16+
# Rails 7.1.3+ freezes certain internal arrays for
17+
# performance and safety. Rails::Engine.paths["app"] is frozen
18+
# but EngineCart tries to modify it, leading to errors like:
19+
# Failure/Error: EngineCart.load_application!
20+
# FrozenError: can't modify frozen Array
21+
Rails::Engine.subclasses.each do |engine|
22+
paths = engine.paths['app']
23+
engine.paths['app'] = paths.dup unless paths.frozen?
24+
end
25+
1526
require 'rspec/rails'
1627

1728
require 'selenium-webdriver'

0 commit comments

Comments
 (0)