I would just compare the size. Or you can get the MD5 and compare that to be 100% sure, and avoid the ugly diff too.

On 12/10/2010 6:56 PM, Matt Wynne wrote:
Hello folks,

I'm writing some tests for file upload code. The files are binary, images 
mostly. I'm futzing around a bit, trying to figure out how to assert that the 
uploaded file is the same as some golden master. If I do this:

File.read(uploaded_file_path).should == File.read(path_to_expected_file)

Then when it fails, I get an ugly diff of the difference between the binary 
files. So I'm about to invent something of my own. Has anyone got a good 
pattern for doing this already?

cheers,
Matt

m...@mattwynne.net
07974 430184

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to