Just reading this, not reading it, it could be possible that both just return nil and nil is equal to nil. So it would be better to check that they return the same value.

However I believe that they return nil, because the error you had with speccing it out (no method / for nil) probably comes from `content_length` being nil. Download specs are hard :(