test/test_helper.rb in resque-scheduler-2.0.1 vs test/test_helper.rb in resque-scheduler-2.1.0
- old
+ new
@@ -4,11 +4,11 @@
dir = File.dirname(File.expand_path(__FILE__))
require 'rubygems'
require 'test/unit'
-require 'mocha'
+require 'mocha/setup'
require 'resque'
$LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__)) + '/../lib'
require 'resque_scheduler'
require 'resque_scheduler/server'
@@ -55,11 +55,11 @@
def self.xtest(*args) end
def self.setup(&block) define_method(:setup, &block) end
def self.teardown(&block) define_method(:teardown, &block) end
end
(class << klass; self end).send(:define_method, :name) { name.gsub(/\W/,'_') }
- klass.class_eval &block
+ klass.class_eval(&block)
end
class FakeCustomJobClass
def self.scheduled(queue, klass, *args); end
end
@@ -80,6 +80,13 @@
class SomeRealClass
def self.queue
:some_real_queue
end
+end
+
+def nullify_logger
+ Resque::Scheduler.mute = nil
+ Resque::Scheduler.verbose = nil
+ Resque::Scheduler.logfile = nil
+ Resque::Scheduler.logger = nil
end