易于在测试中发现调试输出

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了易于在测试中发现调试输出相关的知识,希望对你有一定的参考价值。

Put this in `test_helper.rb` and call with `show(object1, object2, etc.)`
  1. def show(*entries)
  2. # used to preceed logger output to make it easier to find
  3. puts "e[1;32m INSPECTING: #{Time.now} e[0m"
  4. entries.each do |entry|
  5. puts "e[1;31m #{entry.inspect}e[0m"
  6. end
  7. end

以上是关于易于在测试中发现调试输出的主要内容,如果未能解决你的问题,请参考以下文章