Skip to content

Commit 1528328

Browse files
committed
fix the build
1 parent b8e042c commit 1528328

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/resque_hook_test.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ def self.perform
4747
assert_equal(2, counter)
4848
end
4949

50-
it 'calls after_fork after each job' do
50+
it 'calls after_fork after each job if forking' do
5151
counter = 0
5252

5353
Resque.after_fork { counter += 1 }
5454
2.times { Resque::Job.create(:jobs, CallNotifyJob) }
5555

5656
assert_equal(0, counter)
5757
@worker.work(0)
58-
assert_equal(2, counter)
58+
assert_equal(@worker.will_fork? ? 2 : 0, counter)
5959
end
6060

6161
it 'calls before_first_fork before forking' do
@@ -115,7 +115,12 @@ def self.perform
115115

116116
assert(!first && !second)
117117
@worker.work(0)
118-
assert(first && second)
118+
119+
if @worker.will_fork?
120+
assert(first && second)
121+
else
122+
assert(!first && !second)
123+
end
119124
end
120125

121126
it 'registers multiple before_pause hooks' do

0 commit comments

Comments
 (0)