diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-04-27 14:58:04 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-04-27 14:58:04 -0700 |
commit | 0c076c00578ee58ac98108ddd8c01ac904bdaffd (patch) | |
tree | 48ccdccaba4c2f5b5b2fd15bebe979a3eab125f3 /railties/lib/rails | |
parent | 90e90d61cbf89aff779062cc819f2e5e71eb0f5c (diff) | |
download | rails-0c076c00578ee58ac98108ddd8c01ac904bdaffd.tar.gz rails-0c076c00578ee58ac98108ddd8c01ac904bdaffd.tar.bz2 rails-0c076c00578ee58ac98108ddd8c01ac904bdaffd.zip |
adding the `jobs` method to the test queue for getting a list of test
jobs.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/queueing.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/lib/rails/queueing.rb b/railties/lib/rails/queueing.rb index 516447315f..9ba55c0109 100644 --- a/railties/lib/rails/queueing.rb +++ b/railties/lib/rails/queueing.rb @@ -8,6 +8,14 @@ module Rails # Jobs are run in a separate thread to catch mistakes where code # assumes that the job is run in the same thread. class TestQueue < ::Queue + # Get a list of the jobs off this queue. This method may not be + # available on production queues. + def jobs + @que.dup + end + + # Drain the queue, running all jobs in a different thread. This method + # may not be available on production queues. def drain # run the jobs in a separate thread so assumptions of synchronous # jobs are caught in test mode. |