From: "Bartosz Dziewoński" Date: 2012-08-07T02:44:57+09:00 Subject: Re: Questions about test-driven development and optparse If I were you, I wouldn't use regexps for testing the output here. That would imply that you're basically only checking that the output format is right. You should probably take a simple, short log file, and package it with the tests. Then run it once for each options combination you want to test, save the output (which you have manually verified is correct), and write a test that checks the the output still looks exactly the same. You could also just forget about tests here entirely. What you have here is (when you don't count country code list and documentation) a 100-line script that does just one thing, and you've already verified it works. Tests are only useful in one case – when you are making changes to your software and want to make sure they don't introduce bugs in old code. Still, it might turn out later that you actually need to change stuff, and then you'll be wishing you wrote the tests earlier :( -- Matma Rex