Easy-to-spot debugging output in tests

/ Published in: Rails
Save to your folder(s)

Put this in `test_helper.rb` and call with `show(object1, object2, etc.)`

Copy this code and paste it in your HTML
  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

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.