KCErb/shoes4 — pull request #1 by jasonrclark (2014-05-03 18:12:38+00:00)
Title: Download specs

Managed to get to the bottom of the progress spec issues, and what you were seeing was actually a bug, not just a specing issue!

The root cause was that open-uri calls the `content_length_proc` with a value of `nil` if the HTTP request didn't have a `"Content-Length"` header present on it. I found this out actually by digging into the open-uri code itself (https://github.com/ruby/ruby/blob/trunk/lib/open-uri.rb#L623-L635) but it resulted in the error you were seeing @KCErb since your stubbing didn't provide a length.

My additions here now checks with and without the content-length to make sure the basics are working. There's still room for more thorough testing on the internal logic of the progress proc, but this is sufficient for now.

Feel free to merge this into your branch on your fork when you're happy with it. Once you've done that, then I can merge your original PR on the main repo with our work all bundled together.

Thanks again for the work on this. I'm quite happy with the step this makes forward on testing the downloads! :heart: :rocket: :boom: