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

FakeWeb doesn't mimic Net::HTTP's check "#read_body called twice (IOError)" #39

Open
chrisk opened this issue May 15, 2013 · 0 comments

Comments

@chrisk
Copy link
Owner

chrisk commented May 15, 2013

This should raise Net::HTTPOK#read_body called twice (IOError) (or whatever the appropriate Net::HTTPResponse class is, there) whether or not the request hits FakeWeb:

%w(net/http rubygems fakeweb).each { |it| require it }
FakeWeb.register_uri(:get, "http://example.com", body: "example")
Net::HTTP.new("example.com").request_get("/") do |response|
  2.times { response.read_body { |part| p part } }
end

I found this with 1.9.3 p392; need to check the behavior of all the other implementations. I also see some other things in there we're probably not handling correctly, like #read_body's deprecated-but-still-working dest parameter—need to file issues for those.

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

No branches or pull requests

1 participant