You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm stubbing request to return response from file harvested with curl:
stub_request(:get, "www.example.com").to_return(File.new('/path/to/curl/stub/file'))
Then I'm making the request:
resp = Net::HTTP.get('www.example.com', '/')
Unfortunately, resp.code is always returned as 200 and resp.message as "", even though stub file has correct status code/message as a first line:
HTTP/1.1 404 Not Found,
or
HTTP/1.1 302 Found
The text was updated successfully, but these errors were encountered:
Status codes seem to be fixed in 0.9.1, however I'm still getting empty message - it would be good to stub it from first line as well - just to have stubbed response closely mocking a real one...
I'm stubbing request to return response from file harvested with curl:
stub_request(:get, "www.example.com").to_return(File.new('/path/to/curl/stub/file'))
Then I'm making the request:
resp = Net::HTTP.get('www.example.com', '/')
Unfortunately, resp.code is always returned as 200 and resp.message as "", even though stub file has correct status code/message as a first line:
HTTP/1.1 404 Not Found,
or
HTTP/1.1 302 Found
The text was updated successfully, but these errors were encountered: