I am testing some Ruby code and have a failing Test::Unit::TestCase. Unfortunately, the failure report only gives me the top error, not a full stack trace. Specifically, it says:
1) Failure:
test_tp_make(TestScripts::TestTpMake) [test/test_scripts.rb:73]:
Exception raised:
<#<NoMethodError: undefined method `[]' for nil:NilClass>>.
The line number referenced (73) is the start of an assert_nothing_raised code block in my test case, which in turn starts another code block, which in turn calls in to a large library.
I have tried running the test with the --verbose flag, unfortunately this does not change the exception output. I tried consulting the Test::Unit documentation, but it does not seem to enumerate the available options (for example, there's nothing useful here). Searching the web and StackOverflow surfaced some answers on how to enable stack tracing in Rails, but this is non-Rails ruby code.
I could extract the failing code from the test and run it outside of Test::Unit, enabling me to see all the output. But it will be a pain to do this every time I have a failing test.
Does anyone know how to get Test::Unit to give me a full stack trace?
rake
? – Isolative