Re: [rspec-users] Comparing files

2010-12-11 Thread Ben Mabey
On 12/11/10 2:03 AM, Matt Wynne wrote: On 10 Dec 2010, at 16:21, Ben Mabey wrote: On 12/10/10 8:56 AM, 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 uploa

Re: [rspec-users] Comparing files

2010-12-11 Thread Matt Wynne
On 10 Dec 2010, at 16:21, Ben Mabey wrote: > On 12/10/10 8:56 AM, 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 s

Re: [rspec-users] Comparing files

2010-12-10 Thread George Dinwiddie
On 12/10/10 12:07 PM, Josh Chisholm wrote: On Fri, Dec 10, 2010 at 4:30 PM, George Dinwiddie wrote: I once saw (but now cannot find) and image compare library that did a "fuzzy compare" that wasn't fooled by pixel differences. I've looked for this several times, but haven't been able to turn

Re: [rspec-users] Comparing files

2010-12-10 Thread Ben Mabey
On 12/10/10 8:56 AM, 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_pa

Re: [rspec-users] Comparing files

2010-12-10 Thread Josh Chisholm
On Fri, Dec 10, 2010 at 4:30 PM, George Dinwiddie wrote: > Matt, > > On 12/10/10 9:56 AM, 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 uploade

Re: [rspec-users] Comparing files

2010-12-10 Thread Joseph Wilk
On Fri, Dec 10, 2010 at 3: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: > > Fil

Re: [rspec-users] Comparing files

2010-12-10 Thread George Dinwiddie
Matt, On 12/10/10 9:56 AM, 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_fi

Re: [rspec-users] Comparing files

2010-12-10 Thread Ben Lovell
Cyclic redundancy check (crc) Sent from my iPhone On 10 Dec 2010, at 15:56, 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 sa

Re: [rspec-users] Comparing files

2010-12-10 Thread Joseph Wilk
On 10/12/2010 15:56, 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(upload

Re: [rspec-users] Comparing files

2010-12-10 Thread Joseph Wilk
On 10/12/2010 15:56, 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(upload

Re: [rspec-users] Comparing files

2010-12-10 Thread Evgeniy Dolzhenko
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 figu

Re: [rspec-users] Comparing files

2010-12-10 Thread Matt Wynne
On 10 Dec 2010, at 15:56, 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.re

[rspec-users] Comparing files

2010-12-10 Thread Matt Wynne
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_