Skip to content

Commit b3f76a2

Browse files
committed
Add specs for IndirectImmediateExecutor characteristics
1 parent ac37cf4 commit b3f76a2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

spec/concurrent/executor/indirect_immediate_executor_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,19 @@ module Concurrent
88
subject { IndirectImmediateExecutor.new }
99

1010
it_should_behave_like :executor_service
11+
12+
it "runs its tasks synchronously" do
13+
start = Time.now
14+
subject.post { sleep 0.1 }
15+
16+
expect(Time.now - start).to be >= 0.1
17+
end
18+
19+
it "runs the task on a separate thread" do
20+
used_thread = nil
21+
subject.post { used_thread = Thread.current }
22+
23+
expect(used_thread).not_to be(Thread.current)
24+
end
1125
end
1226
end

0 commit comments

Comments
 (0)