From 3e6e0035fc7b84b54d6044347f0b83d5a6c86975 Mon Sep 17 00:00:00 2001 From: Aaron Quint Date: Tue, 4 Oct 2011 01:20:30 +0200 Subject: [PATCH] Add test for multiple callbacks --- test/test_resque-metrics.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/test_resque-metrics.rb b/test/test_resque-metrics.rb index c0bb24b..13ab40a 100644 --- a/test/test_resque-metrics.rb +++ b/test/test_resque-metrics.rb @@ -42,15 +42,20 @@ def test_should_record_avg_job_time def test_should_call_callbacks recorded = [] + recorded_count = 0 Resque::Metrics.on_job do |klass, queue, time| recorded << [klass, queue, time] end + Resque::Metrics.on_job do |klass, queue, time| + recorded_count += 1 + end work_job work_job assert_equal 2, recorded.length assert_equal SomeJob, recorded[0][0] assert_equal :jobs, recorded[0][1] assert recorded[0][2] > 0 + assert_equal 2, recorded_count end private