Skip to content

Commit 4de741f

Browse files
onosteveklabnik
authored andcommitted
1 parent 80a5e55 commit 4de741f

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

test/resque_test.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,16 @@
276276
end
277277
end
278278

279+
it "inlining jobs in inline job" do
280+
begin
281+
Resque.inline = true
282+
Resque.enqueue(NestedJob)
283+
assert_equal 0, Resque.size(:ivar)
284+
ensure
285+
Resque.inline = false
286+
end
287+
end
288+
279289
it 'treats symbols and strings the same' do
280290
assert_equal Resque.queue(:people), Resque.queue('people')
281291
end

test/test_helper.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ class SomeIvarJob < SomeJob
7676
@queue = :ivar
7777
end
7878

79+
class NestedJob
80+
@queue = :nested
81+
def self.perform
82+
Resque.enqueue(SomeIvarJob, 20, '/tmp')
83+
end
84+
end
85+
7986
class SomeMethodJob < SomeJob
8087
def self.queue
8188
:method

0 commit comments

Comments
 (0)