Hello,

On Monday, May 7, 2012 10:48:35 AM UTC-3, Jedrin wrote:
>
>
> The test seems to fail because the one  downloaded by hand has 
> newlines of the form 
> "\r\n" whereas the one that the test program downloads using rack/test 
> has newlines of the form 
> "\r\r\n" 
>
>
If you want identical files then you should tell Ruby to open your file in 
a binary mode.
 

>  Any obvious insights from my test code below ? 
>
> Thanks .. 
>
 

>     csf = File.open(csv_path,'w'){|f| f.write(last_response.body)} 
>
>
Change the mode from 'w' to 'wb' (write binary)

Also, don't forget to close the file (csf.close) as you keep that open in 
your test, leaking file handlers.

--
Luis Lavena

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/oyWnXIhZVRgJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to