module Clockwork::Test::Methods

Public Instance Methods

block_for(job) click to toggle source
# File lib/clockwork/test.rb, line 83
def block_for(job)
  manager.block_for(job)
end
clear!() click to toggle source
# File lib/clockwork/test.rb, line 71
def clear!
  Clockwork::Test.manager = Clockwork::Test::Manager.new
end
ran_job?(job) click to toggle source
# File lib/clockwork/test.rb, line 75
def ran_job?(job)
  manager.ran_job?(job)
end
run(opts = {}) click to toggle source
# File lib/clockwork/test.rb, line 53
def run(opts = {})
  file = opts[:file] || "./config/clock.rb"

  run_opts = {
    max_ticks: opts[:max_ticks],
    start_time: opts[:start_time],
    end_time: opts[:end_time],
    tick_speed: opts[:tick_speed]
  }

  manager.run(run_opts) do
    # TODO parse file rather than loading it
    # and overloading Clockwork::Methods::every
    # and Clockwork::Methods::configure
    load file
  end
end
times_run(job) click to toggle source
# File lib/clockwork/test.rb, line 79
def times_run(job)
  manager.times_run(job)
end