Sha256: 0386b439cad247bc5a642c5f0fedd06803611d309acfb8f91877019fcdcf3b68
Contents?: true
Size: 716 Bytes
Versions: 11
Compression:
Stored size: 716 Bytes
Contents
require 'minitest/autorun' require 'active_record' require 'mysql2' require 'benchmark' require 'jobs' class WorkhorseTest < ActiveSupport::TestCase def setup Workhorse::DbJob.delete_all end protected def work(time = 2, options = {}) options[:pool_size] ||= 5 options[:polling_interval] ||= 1 with_worker(options) do sleep time end end def with_worker(options = {}) w = Workhorse::Worker.new(options) w.start begin yield(w) ensure w.shutdown end end end ActiveRecord::Base.establish_connection adapter: 'mysql2', database: 'workhorse', username: 'travis', password: '', pool: 10, host: :localhost require 'db_schema' require 'workhorse'
Version data entries
11 entries across 11 versions & 1 rubygems