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

Ignore parse exceptions #1066

Merged
merged 1 commit into from
Sep 18, 2024
Merged

Ignore parse exceptions #1066

merged 1 commit into from
Sep 18, 2024

Conversation

c960657
Copy link
Contributor

@c960657 c960657 commented Aug 2, 2024

Tests are currently failing in master due to a change in the latest version of REXML.

REXML previously accepted some invalid XML (e.g. foo bar) but raised on other (<foo bar). Since v3.3.3 it also raises on foo bar (see ruby/rexml#184).

Likewise, WebMock::Util::JSON.parse accepts some invalid JSON (e.g. foo bar) but raises on other (e.g. [foo bar).

It seems both matchers should just rescue and ignore parse exceptions.

@c960657 c960657 changed the title Rescue exceptions Ignore parse exceptions Aug 2, 2024
@c960657
Copy link
Contributor Author

c960657 commented Aug 2, 2024

The Ruby head test fails due to igrigorik/em-http-request#365.

@bblimke bblimke merged commit 4a8a513 into bblimke:master Sep 18, 2024
6 of 8 checks passed
@c960657 c960657 deleted the invalid-xml branch September 18, 2024 19:51
@bblimke
Copy link
Owner

bblimke commented Sep 18, 2024

Thank you @c960657 ! I appreciate the explanation and the PR. I agree it makes sense to ignore the parsing exceptions and simply not match the request body.

Any suggestions on how to fix the em-http-client issue in Ruby head, or just wait for em-http-client to be fixed?

@c960657
Copy link
Contributor Author

c960657 commented Sep 18, 2024

Hmm, no, I don't think there is anything WebMock can do about the em-http-client issue.

@bblimke
Copy link
Owner

bblimke commented Sep 18, 2024

It is annoying that webmock build fails due to a problem with just one of http clients.

@c960657
Copy link
Contributor Author

c960657 commented Sep 22, 2024

We can use skip to bypass the tests for em-http-client on Ruby HEAD (see #1070).

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.

3 participants