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 RSpec/StubProducts cop #18

Merged
merged 7 commits into from
Apr 7, 2022
Merged

Add RSpec/StubProducts cop #18

merged 7 commits into from
Apr 7, 2022

Conversation

makesime
Copy link
Contributor

No description provided.

@makesime makesime self-assigned this Mar 31, 2022
@makesime makesime requested a review from Bhacaz March 31, 2022 15:25
CHANGELOG.md Outdated Show resolved Hide resolved
lib/rubocop/cop/rspec/stub_products.rb Show resolved Hide resolved
@makesime makesime requested a review from Bhacaz April 4, 2022 15:27
config/default.yml Show resolved Hide resolved
Comment on lines 38 to 40
subst = "stub_products(\\k<product> => #{product_is_available}"

corrector.replace(node, node.source.gsub(/(?'method'^[^(]*).(?'product'[^)]+)/m, subst))
Copy link
Collaborator

Choose a reason for hiding this comment

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

J'ai testé ta cop sur notre projet rails (DM si tu sais pas comment) et il y a le cas où on utilise la méthode sans parenthèse qui n'est pas bien gérer 😬

image

Copy link
Collaborator

@Bhacaz Bhacaz left a comment

Choose a reason for hiding this comment

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

Nice job

@Bhacaz Bhacaz merged commit 987349c into main Apr 7, 2022
@Bhacaz Bhacaz deleted the HOS_1287__use_stub_products branch April 7, 2022 18:35
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