我是使用Rails进行功能测试的忠实粉丝。如果我能以可读的方式查看测试日志而不将所有内容压缩成一条大线,那么帮助调试真正令人敬畏的东西。
例如,如果测试失败,我会得到大约50行:
Could not log "render_template.action_view" event. NoMethodError: undefined method `example_group' for nil:NilClass ["/Users/***/.rvm/gems/ruby-2.3.0/gems/rspec-rails-3.6.0/lib/rspec/rails/view_rendering.rb:67:in `current_example_group'", "/Users/***/.rvm/gems/ruby-2.3.0/gems/rspec-rails-3.6.0/lib/rspec/rails/view_rendering.rb:71:in `render_template'", "/Users/***/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.3/lib/active_support/subscriber.rb:95:in `finish'", "/Users/***/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.3/lib/active_support/log_subscriber.rb:83:in `finish'", "/Users/***/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.3/lib/active_support/notifications/fanout.rb:102:in `finish'", "/Users/***/.rvm/gems
有可能吗?我尝试过像better_logging,漂亮的印刷品等宝石,但没有运气。