Skip to content

Commit 702d54a

Browse files
justin808claude
andcommitted
Fix helpful message tests by mocking Shakapacker installation
Mock the Shakapacker binary existence check to return true, so that ensure_shakapacker_installed skips the installation process and the generator proceeds to show the success message that the tests expect. This fixes the test failures where Shakapacker installation was failing in CI environment, causing error messages instead of success messages. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent b1427a1 commit 702d54a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

spec/react_on_rails/generators/install_generator_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@
5454
GeneratorMessages.format_info(GeneratorMessages.helpful_message_after_installation)
5555
end
5656

57+
before do
58+
# Mock Shakapacker installation to succeed so we get the success message
59+
allow(File).to receive(:exist?).and_call_original
60+
allow(File).to receive(:exist?).with("bin/shakapacker").and_return(true)
61+
allow(File).to receive(:exist?).with("bin/shakapacker-dev-server").and_return(true)
62+
end
63+
5764
specify "base generator contains a helpful message" do
5865
run_generator_test_with_args(%w[], package_json: true)
5966
# GeneratorMessages.output is an array with the git error being the first one

0 commit comments

Comments
 (0)