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

Fix example code in the SpecificMatcher cop #120

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

boris-petrov
Copy link
Contributor

The title says it all.

Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with main (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).

@boris-petrov boris-petrov requested a review from a team as a code owner May 14, 2024 19:15
@@ -23,7 +23,7 @@ module Capybara
# expect(page).to have_no_link('foo', class: 'cls', href: 'http://example.com')
# expect(page).to have_table(class: 'cls')
# expect(page).to have_select
# expect(page).to have_field('foo')
# expect(page).to have_field(with: 'foo')
Copy link
Member

Choose a reason for hiding this comment

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

question) Example to verify that the name attribute has an input field of 'foo', is there a problem with the code in the original example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not exactly a problem per se, it's just that all the rest of the example correspond to a line in the bad part. Only the last one is different - and I think the intention was for it also to be the same - just the correct way to write it. Adding the with: does that - makes it with the same meaning as the "bad" example.

@ydah
Copy link
Member

ydah commented Jun 3, 2024

Could you check failed CI?

@boris-petrov
Copy link
Contributor Author

Sorry about that. I think I fixed it.

Copy link
Member

@ydah ydah 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!

@ydah ydah merged commit 0593c65 into rubocop:main Jun 3, 2024
25 checks passed
@boris-petrov boris-petrov deleted the fix-example branch June 3, 2024 17:13
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.

None yet

2 participants