test/support/qc_helper.rb in qc-mailer-0.0.2 vs test/support/qc_helper.rb in qc-mailer-0.0.3
- old
+ new
@@ -1,31 +1,26 @@
module QCHelper
+ def enqueue_stub
+ proc do |method, *args|
+ klass = eval(method.split(".").first)
+ msg = method.split(".").last
+ klass.send(msg, *args)
+ end
+ end
+
def setup
init_db
- silence_logger
end
def teardown
QC.delete_all
end
- def silence_logger
- QC.define_singleton_method :log do |*args| nil; end # silence QC logger
- end
-
def init_db(table_name="queue_classic_jobs")
QC::Conn.execute("SET client_min_messages TO 'warning'")
QC::Setup.drop
QC::Setup.create
QC::Conn.disconnect
end
- def enqueue_stub
- proc do |method, *args|
- klass = eval(method.split(".").first)
- msg = method.split(".").last
- klass.send(msg, *args)
- end
- end
-
-end
\ No newline at end of file
+end