Skip to content

Commit d15c5d6

Browse files
committed
Moved let statements to a different context.
1 parent 63e6eea commit d15c5d6

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

spec/concurrent/executor/cached_thread_pool_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ module Concurrent
44

55
describe CachedThreadPool do
66

7-
let(:latch) { Concurrent::CountDownLatch.new }
8-
97
subject do
108
described_class.new(fallback_policy: :discard)
119
end
@@ -17,6 +15,8 @@ module Concurrent
1715

1816
it_should_behave_like :thread_pool
1917

18+
let(:latch) { Concurrent::CountDownLatch.new }
19+
2020
context '#initialize' do
2121

2222
it 'sets :max_length to DEFAULT_MAX_POOL_SIZE' do

spec/concurrent/executor/fixed_thread_pool_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ module Concurrent
44

55
describe FixedThreadPool do
66

7-
let(:latch) { Concurrent::CountDownLatch.new }
8-
97
let!(:num_threads){ 5 }
108
subject { described_class.new(num_threads) }
119

@@ -16,6 +14,8 @@ module Concurrent
1614

1715
it_should_behave_like :thread_pool
1816

17+
let(:latch) { Concurrent::CountDownLatch.new }
18+
1919
context '#initialize default values' do
2020

2121
subject { described_class.new(5) }

spec/concurrent/executor/ruby_thread_pool_executor_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ module Concurrent
44

55
describe RubyThreadPoolExecutor, :type=>:mrirbx do
66

7-
let(:latch) { Concurrent::CountDownLatch.new }
8-
97
after(:each) do
108
subject.kill
119
subject.wait_for_termination(0.1)
@@ -28,6 +26,7 @@ module Concurrent
2826
context '#remaining_capacity' do
2927

3028
let!(:expected_max){ 100 }
29+
let(:latch) { Concurrent::CountDownLatch.new }
3130

3231
subject do
3332
RubyThreadPoolExecutor.new(

spec/concurrent/executor/thread_pool_shared.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
shared_examples :thread_pool do
44

5-
let(:latch) { Concurrent::CountDownLatch.new }
6-
75
after(:each) do
86
subject.kill
97
subject.wait_for_termination(0.1)
108
end
119

1210
it_should_behave_like :executor_service
1311

12+
let(:latch) { Concurrent::CountDownLatch.new }
13+
1414
context '#auto_terminate?' do
1515

1616
it 'returns true by default' do

0 commit comments

Comments
 (0)