How to show longer traces in Rails TestCases

前端 未结 4 2333
走了就别回头了
走了就别回头了 2021-02-15 17:19

Is there a config variable to set, or some other way to get Rails ActiveSupport::TestCase to show more than one trace line? It is really hard to de

4条回答
  •  悲&欢浪女
    2021-02-15 18:17

    You could try to wrap failing code with:

    begin
      # failing code
    rescue Exception => e
      puts e.message
      puts e.backtrace
    end
    

    Another way is debugging your application with ruby-debug.

提交回复
热议问题