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

Adds support for invoking the on_error handler. #275

Closed
wants to merge 3 commits into from

Conversation

hsume2
Copy link

@hsume2 hsume2 commented Apr 8, 2013

Hi,

When writing tests for an EventMachine client, I wanted to ensure that on_error handlers were properly triggered.

This PR adds support for to_errback:

stub_request(:get, "www.example.com").to_errback

Which will then invoke the on_error handler.

@grosser
Copy link
Contributor

grosser commented Apr 8, 2013

👍

@bblimke
Copy link
Owner

bblimke commented Apr 8, 2013

Thank you for this pull request and suggesting this feature.
WebMock purpose is to provide http client independent mocking API. This change adds EM only method to WebMock generic API, which unfortunately makes it useless for all other http clients except EM.
WebMock API has to_raise method. Maybe it's possible to implement to_raise behaviour in EM adapter instead?

@hsume2
Copy link
Author

hsume2 commented Apr 9, 2013

@bblimke thanks for the suggestion, that makes sense. I'll give that a shot and see if I can get anywhere with that :)

@bblimke
Copy link
Owner

bblimke commented Jun 4, 2013

to_errback is only em-http-request specific so this pull request can't be merged in this form.

@bblimke bblimke closed this Jun 4, 2013
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