Module: Resqued::TestCase::LoadConfig

Included in:
Resqued::TestCase
Defined in:
lib/resqued/test_case.rb

Instance Method Summary collapse

Instance Method Details

#assert_resqued(*paths) ⇒ Object

Test your resqued config.

If you do this to start resqued:

$ resqued config/resqued-environment.rb config/resqued-workers.rb

Then you’ll want to do this in a test:

assert_resqued 'config/resqued-environment.rb', 'config/resqued-workers.rb'


16
17
18
19
20
21
22
# File 'lib/resqued/test_case.rb', line 16

def assert_resqued(*paths)
  config = Resqued::Config.new(paths)
  config.before_fork(RuntimeInfo.new)
  config.build_workers
  config.after_fork(FakeWorker.new)
  config.after_exit(Resqued::WorkerSummary.new(alive_time_sec: 1.0, process_status: Process::Status.allocate))
end