I am writing Rails tests using the standard Test::Unit/TestCase.
Is there any way to somehow filter what gets printed to the log, so that you only print the stack for specific test cases.
I have a functional test file with many test cases in it, and I'm really only interested in debugging one test case. Printing my own log statements still requires searching through a few thousand lines of generated log. Or something similar to the RSpec 'pending' functionality.
Run from a command line
ruby test/unit/my_model.rb
to run one test suite. You can also use a debugger, such as (wrapped by) RubyMine or pry, to stop on a specific test case and look at the log.But if a sledge-hammer does not solve the problem, you can use tweezers:
config.logger.level = Logger::WARN
in yourtest.rb
, from Set logging levels in Ruby on Rails