Skip to content

Instantly share code, notes, and snippets.

@mattconnolly
Last active August 29, 2015 14:00
Show Gist options
  • Save mattconnolly/73e614f068d8e1d440e3 to your computer and use it in GitHub Desktop.
Save mattconnolly/73e614f068d8e1d440e3 to your computer and use it in GitHub Desktop.
spec_helper - clear the test log before each test run.
# near the top of spec_helper.rb
# clear the test log file before we start.
log_file = Rails.root.join("log/test.log")
File.truncate(log_file, 0) if File.exist?(log_file)
@mattconnolly
Copy link
Author

Actually this seems to work better when put near the top of spec_helper than in a config.before(:suite) block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment