@@ -4,10 +4,6 @@ module Concurrent
44
55 describe OptionsParser do
66
7- subject do
8- Class . new { include OptionsParser } . new
9- end
10-
117 let ( :executor ) { ImmediateExecutor . new }
128
139 let ( :task_pool ) { ImmediateExecutor . new }
@@ -16,59 +12,59 @@ module Concurrent
1612 context '#get_executor_from' do
1713
1814 it 'returns the given :executor' do
19- subject . get_executor_from ( executor : executor ) . should eq executor
15+ OptionsParser :: get_executor_from ( executor : executor ) . should eq executor
2016 end
2117
2218 it 'returns the global operation pool when :operation is true' do
2319 Concurrent . configuration . should_receive ( :global_operation_pool ) .
2420 and_return ( :operation_pool )
25- subject . get_executor_from ( operation : true )
21+ OptionsParser :: get_executor_from ( operation : true )
2622 end
2723
2824 it 'returns the global task pool when :operation is false' do
2925 Concurrent . configuration . should_receive ( :global_task_pool ) .
3026 and_return ( :task_pool )
31- subject . get_executor_from ( operation : false )
27+ OptionsParser :: get_executor_from ( operation : false )
3228 end
3329
3430 it 'returns the global operation pool when :task is false' do
3531 Concurrent . configuration . should_receive ( :global_operation_pool ) .
3632 and_return ( :operation_pool )
37- subject . get_executor_from ( task : false )
33+ OptionsParser :: get_executor_from ( task : false )
3834 end
3935
4036 it 'returns the global task pool when :task is true' do
4137 Concurrent . configuration . should_receive ( :global_task_pool ) .
4238 and_return ( :task_pool )
43- subject . get_executor_from ( task : true )
39+ OptionsParser :: get_executor_from ( task : true )
4440 end
4541
4642 it 'returns the global task pool when :executor is nil' do
4743 Concurrent . configuration . should_receive ( :global_task_pool ) .
4844 and_return ( :task_pool )
49- subject . get_executor_from ( executor : nil )
45+ OptionsParser :: get_executor_from ( executor : nil )
5046 end
5147
5248 it 'returns the global task pool when no option is given' do
5349 Concurrent . configuration . should_receive ( :global_task_pool ) .
5450 and_return ( :task_pool )
55- subject . get_executor_from
51+ OptionsParser :: get_executor_from
5652 end
5753
5854 specify ':executor overrides :operation' do
59- subject . get_executor_from ( executor : executor , operation : true ) .
55+ OptionsParser :: get_executor_from ( executor : executor , operation : true ) .
6056 should eq executor
6157 end
6258
6359 specify ':executor overrides :task' do
64- subject . get_executor_from ( executor : executor , task : true ) .
60+ OptionsParser :: get_executor_from ( executor : executor , task : true ) .
6561 should eq executor
6662 end
6763
6864 specify ':operation overrides :task' do
6965 Concurrent . configuration . should_receive ( :global_operation_pool ) .
7066 and_return ( :operation_pool )
71- subject . get_executor_from ( operation : true , task : true )
67+ OptionsParser :: get_executor_from ( operation : true , task : true )
7268 end
7369 end
7470 end
0 commit comments