Skip to content

[WIP] Fix Battlestation::CLI#run to return 0 when exitstatus is nil - #38

Closed
bachand with Copilot wants to merge 1 commit into
masterfrom
copilot/fix-cli-run-return-value
Closed

[WIP] Fix Battlestation::CLI#run to return 0 when exitstatus is nil#38
bachand with Copilot wants to merge 1 commit into
masterfrom
copilot/fix-cli-run-return-value

Conversation

Copilot AI commented Oct 12, 2025

Copy link
Copy Markdown
Contributor

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Original prompt

The test for Battlestation::CLI#run in spec/battlestation/cli_spec.rb fails because the method returns $?.exitstatus, which is nil when no child process has been run in the test context. The spec expects subject.run to return 0. To fix this, update the implementation in lib/battlestation/cli.rb to return 0 if $?.exitstatus is nil. Update line 50 to:

return $?.exitstatus || 0

This ensures the method returns 0 in the test context and passes the expectation.

Referenced files:

This pull request was created as a result of the following prompt from Copilot chat.

The test for Battlestation::CLI#run in spec/battlestation/cli_spec.rb fails because the method returns $?.exitstatus, which is nil when no child process has been run in the test context. The spec expects subject.run to return 0. To fix this, update the implementation in lib/battlestation/cli.rb to return 0 if $?.exitstatus is nil. Update line 50 to:

return $?.exitstatus || 0

This ensures the method returns 0 in the test context and passes the expectation.

Referenced files:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@bachand

bachand commented Oct 12, 2025

Copy link
Copy Markdown
Owner

I asked Copilot to fix a CI error on #37 but it opened this PR against the master branch when I need to make the change on the branch of #37.

@bachand bachand closed this Oct 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants