Skip to content

Commit 1c30d6b

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

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

spec/spec_helper.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
require 'engine_cart'
1313
EngineCart.load_application!
1414

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

1727
require 'selenium-webdriver'

0 commit comments

Comments
 (0)