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

Use more native rspec matchers in tests #179

Merged
merged 2 commits into from
Jun 9, 2024

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Jun 9, 2024

By using be_a and contain_exactly the tests are more expressive and rspec is better able to tell you what doesn't match. It also removes the (now redundant) size checks on results, given contain_exactly already gives that guarantee.

ekohl added 2 commits June 9, 2024 19:24
This is a more native way of asserting it's a certain class.
This is a more native way to assert results, meaning asserting the size
is redundant.
Copy link

codecov bot commented Jun 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.03%. Comparing base (cfa4977) to head (907fdf9).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #179   +/-   ##
=======================================
  Coverage   95.03%   95.03%           
=======================================
  Files           2        2           
  Lines         161      161           
=======================================
  Hits          153      153           
  Misses          8        8           

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

@bastelfreak bastelfreak merged commit a0eb4d5 into voxpupuli:master Jun 9, 2024
9 checks passed
@ekohl ekohl deleted the more-native-matchers branch June 11, 2024 12:43
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