Class: Woodhouse::Dispatchers::TestDispatcher

Inherits:
Woodhouse::Dispatcher show all
Defined in:
lib/woodhouse/dispatchers/test_dispatcher.rb

Overview

A dispatcher which simply swallows and stores jobs without performing them. This is to be used in testing other applications’ interactions with Woodhouse.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Woodhouse::Dispatcher

#dispatch, #dispatch_job, #initialize, #update_job

Constructor Details

This class inherits a constructor from Woodhouse::Dispatcher

Instance Attribute Details

#job_updatesObject (readonly)

All job updates (used in the Progress extension) which have been dispatched since this dispatcher was last cleared.



8
9
10
# File 'lib/woodhouse/dispatchers/test_dispatcher.rb', line 8

def job_updates
  @job_updates
end

#jobsObject (readonly)

All jobs (Woodhouse::Job) which have been dispatched since this dispatcher was last cleared.



6
7
8
# File 'lib/woodhouse/dispatchers/test_dispatcher.rb', line 6

def jobs
  @jobs
end

Instance Method Details

#clear!Object

Wipe out all stored jobs and job updates.



11
12
13
14
# File 'lib/woodhouse/dispatchers/test_dispatcher.rb', line 11

def clear!
  jobs.clear
  job_updates.clear
end