Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

passing a string (or IO etc?) to #to_return should be a shortcut for setting :body => 'blah' #4

Closed
benpickles opened this Issue Dec 17, 2009 · 3 comments

Comments

Projects
None yet
2 participants
Contributor

benpickles commented Dec 17, 2009

Example:

stub_request(:get, 'example.com').to_return('body')

Should be the same as:

stub_request(:get, 'example.com').to_return(:body => 'body')
Owner

bblimke commented Jan 24, 2010

to_return accepts now raw responses which can be recorded using curl -i.
Raw response can be passed to to_return either as IO object (i.e File) or a String.

Passing just response body to to_return method won't work. This could be possibly supported in webmock by checking the first line of the response. If it doesn't contain HTTP header with status, then it would be treated as a response body.

Contributor

benpickles commented Feb 12, 2010

ah i understand. it's not quite what i was hoping for but useful nevertheless.

Owner

bblimke commented Feb 12, 2010

Ok, closing

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment