Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

excon's response_blocks not called #217

Closed
goblin opened this Issue · 1 comment

2 participants

@goblin

It appears that stub_request.to_return(:body => ...) doesn't call callbacks set via Excon's :response_block, making me unable to test an application that uses them. Here's an example:

https://gist.github.com/3911514

The 'irb test' at the bottom shows that MyApp.doit should simply return the body of the webpage. However the spec fails:

% rspec ./app_spec.rb
F

Failures:

  1) app works
     Failure/Error: a.doit.should eq mystr

       expected: "abcdef123"
            got: ""

       (compared using ==)
     # ./app_spec.rb:12:in `block (2 levels) in <top (required)>'

Finished in 0.00343 seconds

It gets an empty string.

If I add a puts "here" before line 11 in app.rb, it never gets printed - making me think the :response_block is never called.

Can you please confirm / spec / fix?

@goblin goblin referenced this issue in thommay/hobelar
Open

Check's attributes not escaped properly #4

@bblimke
Owner

Thank you for reporting that. It's fixed in WebMock 1.9.2.

@bblimke bblimke closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.