Skip to content

Commit 4526427

Browse files
Mock Gem.loaded_specs for ReactOnRailsPro version
The react_on_rails_pro_version method in Utils tries to get the gem version from Gem.loaded_specs, so we need to mock that too. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 7e96f46 commit 4526427

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spec/dummy/spec/helpers/react_on_rails_helper_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ class PlainReactOnRailsHelper
2727
)
2828

2929
# Mock Pro gem configuration and helper for immediate_hydration
30+
# Also need to mock Gem.loaded_specs for version
31+
gem_spec = Struct.new(:version).new(Gem::Version.new("1.0.0"))
32+
allow(Gem).to receive(:loaded_specs).and_return({ "react_on_rails_pro" => gem_spec })
33+
3034
stub_const("ReactOnRailsPro", Module.new do
3135
def self.configuration
3236
@configuration ||= Struct.new(:immediate_hydration).new(true)

0 commit comments

Comments
 (0)