Skip to content

Instantly share code, notes, and snippets.

@xwmx
Created January 9, 2009 21:18
Show Gist options
  • Save xwmx/45285 to your computer and use it in GitHub Desktop.
Save xwmx/45285 to your computer and use it in GitHub Desktop.
def log_test
if Rails::logger
# When I run tests in rake or autotest I see the same log message multiple times per test for some reason.
# This guard prevents that.
unless @already_logged_this_test
Rails::logger.info "\n\nStarting #{@method_name}\n#{'-' * (9 + @method_name.length)}\n"
end
@already_logged_this_test = true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment