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 support assert_empty, assert_not_empty and refute_empty for RSpec/Rails/MinitestAssertions #1778

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

ydah
Copy link
Member

@ydah ydah commented Jan 11, 2024

This PR is add support assert_empty, assert_not_empty and refute_empty for RSpec/Rails/MinitestAssertions.
Related to rubocop/rubocop-rspec_rails#7


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).

@ydah ydah requested a review from a team as a code owner January 11, 2024 05:30
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.

Nice refactoring, and nice addition. Thank you!

@ydah ydah force-pushed the support-assert-empty branch from 6095eb7 to 9d402fe Compare January 11, 2024 06:42
@ydah ydah requested a review from pirj January 11, 2024 06:43
@ydah ydah force-pushed the support-assert-empty branch from 9d402fe to 4d3da80 Compare January 11, 2024 07:33
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.

I think be_empty is a better replacement. A hash or string will be matched by minitest, too?

@ydah ydah force-pushed the support-assert-empty branch from 4d3da80 to 62c0ab5 Compare January 11, 2024 08:59
"expect(#{@actual.source}).#{runner}(eq(#{@expected.source})," \
" #{@fail_message.source})"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I will enable Layout/LineContinuationLeadingSpace in a later PR 😉

@ydah ydah force-pushed the support-assert-empty branch from 62c0ab5 to a23d4e6 Compare January 11, 2024 10:58
@ydah
Copy link
Member Author

ydah commented Jan 11, 2024

Thank you for review. I updated this PR.

@ydah ydah requested review from pirj and bquorning January 11, 2024 11:00
CHANGELOG.md Outdated Show resolved Hide resolved
@G-Rath
Copy link
Contributor

G-Rath commented Jan 11, 2024

This is a really cool addition and refactor! I love having the dedicated mini classes for each assertion group

@ydah ydah force-pushed the support-assert-empty branch from de8cdd4 to 32eb847 Compare January 12, 2024 01:48
@ydah ydah merged commit 0d620f7 into master Jan 12, 2024
24 checks passed
@ydah ydah deleted the support-assert-empty branch January 12, 2024 01:51
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.

4 participants