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

Improve test coverage #58

Merged
merged 2 commits into from
Feb 12, 2025
Merged

Improve test coverage #58

merged 2 commits into from
Feb 12, 2025

Conversation

bquorning
Copy link
Contributor

In this PR we do two things:

  • Instruct SimpleCov to ignore unreachable code. When a case or if exhausts all branches, but the last when/elsif documents behavior we don't want to just change it to a fallback else. In that case we add a :noop or raise ArgumentError and use :nocov: to tell SimpleCov to ignore it.
  • Adds test coverage to spec/rubocop/cop/rspec_rails/http_status_spec.rb for when the rack gem is not loaded.

Those two commits bring line and branch coverage to 100% ✨


Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Updated documentation.
  • Added an entry to the CHANGELOG.md if the new code introduces user-observable changes.
  • The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

@bquorning bquorning requested a review from a team as a code owner February 12, 2025 12:05
@@ -2,7 +2,7 @@

SimpleCov.start do
enable_coverage :branch
minimum_coverage line: 95.17, branch: 85.13
minimum_coverage line: 100, branch: 100
Copy link
Contributor Author

Choose a reason for hiding this comment

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

💯/💯

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

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

Thank you!

@bquorning bquorning force-pushed the improve-test-coverage branch from 362c6a9 to 7ae719f Compare February 12, 2025 13:18
@bquorning bquorning merged commit cc58bde into master Feb 12, 2025
27 checks passed
@bquorning bquorning deleted the improve-test-coverage branch February 12, 2025 13:20
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