This seems like a stupid question, but I could not find the answer anywhere. I am using Rails 3.1 with Test::Unit.
When a test fails I only see the top of the stack, e.g.:
ERROR creating a message sends emails (1.35s)
NoMethodError: undefined method `project' for nil:NilClass
/Users/ghempton/.rvm/gems/ruby-1.9.2-p180@gt/gems/activesupport-3.1.3/lib/active_support/whiny_nil.rb:48:in `method_missing'
How do I see the full stack trace?
In computing, a stack trace (also called stack backtrace or stack traceback) is a report of the active stack frames at a certain point in time during the execution of a program. When a program is run, memory is often dynamically allocated in two places; the stack and the heap.
Every single unit test should be self-contained and not depend on others. Don't repeat yourself.
Unit tests can be in any package. In essence they are just separate classes used to test the behaviour of the class being tested.
Your answers confirm my general conclusion that running all unit tests after every local rebuild is the best practice regardless whether one is practicing TDD (test before) or classic unit testing (test after).
uncomment the following line in config/initializers/backtrace_silencers.rb:
Rails.backtrace_cleaner.remove_silencers!
funny that we've lived with this helpful option so long, I even forgot about it! :-)
I wound up fixing this by updating the turn
gem which formats the test output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With