Skip to content

Commit 01a3bd3

Browse files
justin808claude
andcommitted
Fix test stubs for node version checking
Add missing stubs for 'node --version 2>/dev/null' command that is called by check_node_version method. The tests were only stubbing the 'which node' and 'where node' commands but missing the version check call. This fixes RSpec test failures where unexpected method calls were being made during missing_node? checks. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 4ad8c0a commit 01a3bd3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

spec/react_on_rails/generators/install_generator_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
specify "when node is exist" do
7474
stub_const("RUBY_PLATFORM", "linux")
7575
allow(install_generator).to receive(:`).with("which node").and_return("/path/to/bin")
76+
allow(install_generator).to receive(:`).with("node --version 2>/dev/null").and_return("v20.0.0")
7677
expect(install_generator.send(:missing_node?)).to be false
7778
end
7879
end
@@ -93,6 +94,7 @@
9394
specify "when node is exist" do
9495
stub_const("RUBY_PLATFORM", "mswin")
9596
allow(install_generator).to receive(:`).with("where node").and_return("/path/to/bin")
97+
allow(install_generator).to receive(:`).with("node --version 2>/dev/null").and_return("v20.0.0")
9698
expect(install_generator.send(:missing_node?)).to be false
9799
end
98100
end

0 commit comments

Comments
 (0)