Turn on full backtrace in Ruby on Rails TestCase

ID : 274381

viewed : 25

Tags : ruby-on-railsrubyruby-on-rails-3testingruby-on-railsruby





Top 4 Answer for Turn on full backtrace in Ruby on Rails TestCase

vote vote

95

BACKTRACE=blegga rake test  BACKTRACE=blegga rails test # rails 5+ 

Append --trace if you need rake related log.

vote vote

81

Nowdays you can run:

rails test --backtrace 
vote vote

70

Finally figured this out. The issue is with the 'turn' gem included in Rails 3.1, or actually with turn v0.8.2, which is required by the default Gemfile:

group :test do   # Pretty printed test output   gem 'turn', '0.8.2', require: false end 

Turn v0.8.2 doesn't include the full backtrace, so you have to upgrade to get it. I did that by changing the above in my Gemfile to this:

group :test do   # Pretty printed test output   gem 'turn', require: false   gem 'minitest' end 

(I had to add minitest because otherwise turn throws a RuntimeError saying "MiniTest v1.6.0 is out of date.")

Then I ran bundle update turn and got the latest verion (0.9.2 as of this writing). That gives full backtraces.

vote vote

63

Top 3 video Explaining Turn on full backtrace in Ruby on Rails TestCase







Related QUESTION?