Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a true integration test that actually executes Bundler #41

Merged
merged 3 commits into from
Aug 20, 2024

Conversation

mattbrictson
Copy link
Owner

@mattbrictson mattbrictson commented Aug 20, 2024

Before, our CLI tests were doing a significant amount of stubbing to avoid making external calls to Bundler commands. This limited the value of these tests. It also made them tedious to write, and required behind-the-scenes knowledge of when and how the lower-level code called out to Bundler.

In this PR, I refactored the existing CLI tests so that the stubbing is done at a higher level: at the Reporter API. This makes test setup easier while still allowing us to write tests to cover various CLI edge cases, like error handing.

For the primary, "happy path" case, I've created a CLIIntegrationTest. This runs the actual update-interactive executable via Open3.capture3, so every layer of the code base is exercised. Most importantly, Bundler commands themselves are actually executed.

The integration test confirms that when a gem is selected to be updated, the update really happens. It does this by inspecting the Gemfile.lock to see that the gem version was changed as expected.

I also updated the mocha configuration to make stubbing more strict going forward.

@mattbrictson mattbrictson added the 🏠 Housekeeping Non-user facing cleanup and maintenance label Aug 20, 2024
@mattbrictson mattbrictson marked this pull request as draft August 20, 2024 22:40
@mattbrictson mattbrictson marked this pull request as ready for review August 20, 2024 22:51
@mattbrictson mattbrictson merged commit 76a584f into main Aug 20, 2024
8 checks passed
@mattbrictson mattbrictson deleted the integration-test branch August 20, 2024 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏠 Housekeeping Non-user facing cleanup and maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant