From: Shashank Date Date: 2004-03-15T03:09:35+09:00 Subject: Re: [help] unit testing when dealing with files "shasckaw" wrote in message > I'm writting some code wich makes MD5 checksum on some files. I'd like > to write a unit test for that code, but I don't know how to proceed. I > have the same problem with another piece of code which launch a command > line which generate some files. How can I unit test such things? You are in good company here. The TestUnit framework comes with the standard Ruby install and is amazingly easy to use. For details see: http://testunit.talbott.ws/doc/index.html > Should I use ruby mock? How? Or something else? And then what? I will recommend FlexMock for this purpose. You can find FlexMock at: http://onestepback.org/software/flexmock/ Take a look at the article "Mock Turtle Soup": http://onestepback.org/index.cgi/Tech/Ruby/MockTurtleSoup.rdoc > I need help, please! Hope that helps. If you can show snippets of your code, I am sure fellow Rubyists will help more specifically. -- shanko