Skip to content

Commit 8f4e895

Browse files
justin808claude
andcommitted
Apply PR #1784 improvements - clear messages and flexible package manager detection
- Clear GeneratorMessages.output before tests to ensure clean state - Use flexible regex for package manager detection in assertions - Improves test robustness across different environments 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 9cc0847 commit 8f4e895

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spec/react_on_rails/generators/install_generator_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
end
5656

5757
before do
58+
# Clear any previous messages to ensure clean test state
59+
GeneratorMessages.clear
5860
# Mock Shakapacker installation to succeed so we get the success message
5961
allow(File).to receive(:exist?).and_call_original
6062
allow(File).to receive(:exist?).with("bin/shakapacker").and_return(true)
@@ -68,6 +70,7 @@
6870
expect(output_text).to include("🎉 React on Rails Successfully Installed!")
6971
expect(output_text).to include("📋 QUICK START:")
7072
expect(output_text).to include("✨ KEY FEATURES:")
73+
expect(output_text).to match(/bundle && (npm|yarn|pnpm) install/)
7174
expect(output_text).to include("💡 TIP: Run 'bin/dev help'")
7275
end
7376

@@ -78,6 +81,7 @@
7881
expect(output_text).to include("🎉 React on Rails Successfully Installed!")
7982
expect(output_text).to include("📋 QUICK START:")
8083
expect(output_text).to include("✨ KEY FEATURES:")
84+
expect(output_text).to match(/bundle && (npm|yarn|pnpm) install/)
8185
expect(output_text).to include("💡 TIP: Run 'bin/dev help'")
8286
end
8387
end

0 commit comments

Comments
 (0)