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 limitation to reimbursement hook #41

Closed

Conversation

MassimilianoLattanzio
Copy link
Collaborator

Add minimum Solidus version limitation to the reimbursement hook because the deprecation is introduced starting from Solidus 2.11.

Closes #27.

Copy link
Contributor

@abhishekgupta5 abhishekgupta5 left a comment

Choose a reason for hiding this comment

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

LFTM

Comment on lines 33 to 48

context 'when target solidus version is lower than the cop minimum solidus version' do
let(:config) { RuboCop::Config.new('AllCops' => { 'TargetSolidusVersion' => '2.10' }) }

it 'avoid to register an offense when using `#reimbursement_success_hooks.each`' do
expect_no_offenses(<<~RUBY)
reimbursement_success_hooks.each
RUBY
end

it 'avoid to register an offense when using `#reimbursement_failed_hooks.each`' do
expect_no_offenses(<<~RUBY)
reimbursement_failed_hooks.each
RUBY
end
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks to me that these tests are not related with the change.
I would suggest to remove them, minimum_solidus_version 2.11 it's just a configuration and the behavior should be tested on add_offense method.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Tests removed after merging #42

Add minimum Solidus version limitation to the reimbursement hook
because the deprecation is introduced starting from Solidus 2.11.
@MassimilianoLattanzio
Copy link
Collaborator Author

Closed in favor of #43

@MassimilianoLattanzio MassimilianoLattanzio deleted the ml/limit-reimbursement-hook-cop branch July 11, 2023 09:03
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.

Remove reimbursement_success_hooks and reimbursement_failed_hooks
4 participants