Skip to content

Commit

Permalink
Use a throw away log file
Browse files Browse the repository at this point in the history
  • Loading branch information
albus522 committed Sep 23, 2014
1 parent a47e0d7 commit e530194
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion spec/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@
require 'delayed_job'
require 'delayed/backend/shared_spec'

Delayed::Worker.logger = Logger.new('/tmp/dj.log')
if ENV['DEBUG_LOGS']
Delayed::Worker.logger = Logger.new(STDOUT)
else
require 'tempfile'

tf = Tempfile.new('dj.log')
Delayed::Worker.logger = Logger.new(tf.path)
tf.unlink
end
ENV['RAILS_ENV'] = 'test'

# Trigger AR to initialize
Expand Down

0 comments on commit e530194

Please sign in to comment.