Skip to content

Commit a7bada9

Browse files
justin808claude
andcommitted
fix: Add missing 'add' method to PackageManager mock in test
The test was failing because the mock PackageManager double only stubbed the 'install' method, but the actual code calls 'pj.manager.add(packages_array)' in add_js_dependency. This commit adds the 'add' method to the mock's allowed methods, allowing the test to properly verify that package_json gem methods are used instead of system() commands for dependency installation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 63505ab commit a7bada9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec/react_on_rails/generators/message_deduplication_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
# add_npm_dependencies is from GeneratorHelper and is used by add_js_dependencies_batch
8888
# Mock package_json to prevent actual package manager calls
8989
# rubocop:disable RSpec/VerifiedDoubles
90-
mock_manager = double("PackageManager", install: true)
90+
mock_manager = double("PackageManager", install: true, add: true)
9191
mock_package_json = double("PackageJson", manager: mock_manager)
9292
# rubocop:enable RSpec/VerifiedDoubles
9393
allow(install_generator).to receive_messages(

0 commit comments

Comments
 (0)