Finding those irritating puts
Recently a couple of bits of debug have cropped up in the tests on my project and it’s been irritating me a little more each time I run my tests. Today it became too much and it was time to track them down. I knew they were is a spec somewhere, so in the spec_helper I added the following to print out the description of the test instead of the actual debug.
def new_puts(test) $stdout.puts(self.description) end alias :p :new_puts alias :puts :new_puts
Debug free test output. Conditions are perfect.
July 31st, 2008 at 5:20 pm
With Test::Unit you can do “rake TESTOPTS=’-v’ rake” [1] so that each test name is written to stdout as it is executed. I expect there is a RSpec equivalent.
[1] http://www.floehopper.org/articles/2007/09/25/testing-tidbits