Latest on twitter:

Quiet Test::Unit backtraces for Rails

At the Boston.rb hackfest tonight, we addressed the problem of “noisy” Test::Unit backtraces for Rails test suites. Our solution, which should be named quiet_stacktrace.rb and placed into RAILS_ROOT/lib:

http://pastie.caboo.se/123089

You also need to add this line to config/environments/test.rb:

require ‘quiet_stacktrace’

We also confirmed that filter_backtrace is mixed into Test::Unit::TestCase:

http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit/TestCase.html

So, we’d like to set up the next iteration (perhaps the next hackfest?) to work similarly to how Rails sets use_transactional_fixtures. That way, you can turn off quiet backtraces at the test suite or test file level if you need to debug Rails or a plugin.

It needs tests but as a hack, it seems to do the job. Feedback is welcome.

Thanks go to Joe Ferris, Mike Burns, Eric Torrey, Josh Nichols, and Joe’s friend.