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

Replace usage of mockall with explicit TestReportBuilder #25

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

Swatinem
Copy link
Contributor

@Swatinem Swatinem commented Aug 8, 2024

The new TestReportBuilder collects all of the input fed into it. This way one can run assertions on the collected inputs, instead of asserting functions being called.


This might be a bit controversial, as it is a personal preference to avoid mocks.
The practical advantage is that avoiding mockall brings us one step closer to switch back to stable Rust vs using nightly.

@Swatinem Swatinem self-assigned this Aug 8, 2024
Copy link

codecov bot commented Aug 8, 2024

Codecov Report

Attention: Patch coverage is 85.88235% with 48 lines in your changes missing coverage. Please review.

Project coverage is 98.62%. Comparing base (5fed79a) to head (6867663).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files Patch % Lines
src/report/test.rs 55.55% 48 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #25      +/-   ##
==========================================
- Coverage   99.25%   98.62%   -0.64%     
==========================================
  Files          17       17              
  Lines        7425     7393      -32     
==========================================
- Hits         7370     7291      -79     
- Misses         55      102      +47     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@matt-codecov matt-codecov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a bit controversial, as it is a personal preference to avoid mocks.

not a preference i share, haha. but i am not finding mocking in rust to be as easy as it is in any other language i've written tests in, so i guess i'll start trying to design away a need for them in future code

Base automatically changed from swatinem/rm-contextty to main August 16, 2024 07:15
The new `TestReportBuilder` collects all of the input fed into it.
This way one can run assertions on the collected inputs, instead of asserting functions being called.
@Swatinem Swatinem merged commit 3fcba40 into main Aug 16, 2024
5 of 7 checks passed
@Swatinem Swatinem deleted the swatinem/rm-mockall branch August 16, 2024 07:45
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