Sha256: 6a0c304b9b89224618c3697b5aaae0f3311e1dde42bd69d824a27f97ef1fbf1e

Contents?: true

Size: 565 Bytes

Versions: 2

Compression:

Stored size: 565 Bytes

Contents

module QCHelper

  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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
qc-mailer-0.0.2 test/support/qc_helper.rb
qc-mailer-0.0.1 test/support/qc_helper.rb