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

Do not use begin/rescue in tests #198

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

hallelujah
Copy link
Contributor

@hallelujah hallelujah commented Jun 4, 2019

Fixes #196 (comment)

When fetching headers, we rescue any authentication error and set the
headers as application/json

rescue OIDC::AuthenticationError => error

The test rescues an error that is never raised

* Refactored to use assert_raises

TODO:

- [ ] Fix the timeout error test
When fetching headers, we rescue any authentication error and set the headers as application/json
https://github.com/3scale/zync/blob/464cd87fda2275468ad4a94d9fbb54cfe98df10e/app/adapters/generic_adapter.rb#L136

The test rescues some error that is never raised
@hallelujah hallelujah requested a review from mikz June 4, 2019 09:12
@error
end

def error(object)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not using a MiniTest::Mock ?

akostadinov
akostadinov previously approved these changes May 10, 2022
Copy link
Contributor

@akostadinov akostadinov 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 this is a reasonable approach that can be improved another time.

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

3 participants