Posted By

insanedreamer on 07/10/10


testing rails

Versions (?)

Easy-to-spot debugging output in tests

 / Published in: Rails

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: #{} \e[0m"
  4. entries.each do |entry|
  5. puts "\e[1;31m #{entry.inspect}\e[0m"
  6. end
  7. end

Report this snippet  

You need to login to post a comment.