File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -75,23 +75,37 @@ def execute_dereferenceable(subject)
7575
7676 context '#initialize' do
7777
78+ let ( :executor ) { ImmediateExecutor . new }
79+
7880 it 'sets the state to :unscheduled' do
7981 Future . new ( executor : executor ) { nil } . should be_unscheduled
8082 end
8183
8284 it 'raises an exception when no block given' do
8385 expect {
84- Future . new ( executor : executor ) . execute
86+ Future . new . execute
8587 } . to raise_error ( ArgumentError )
8688 end
8789
88- it 'uses the executor given with the :executor option'
90+ it 'uses the executor given with the :executor option' do
91+ executor . should_receive ( :post )
92+ Future . execute ( executor : executor ) { nil }
93+ end
8994
90- it 'uses the global operation pool when :operation is true'
95+ it 'uses the global operation pool when :operation is true' do
96+ Concurrent . configuration . should_receive ( :global_operation_pool ) . and_return ( executor )
97+ Future . execute ( operation : true ) { nil }
98+ end
9199
92- it 'uses the global task pool when :task is true'
100+ it 'uses the global task pool when :task is true' do
101+ Concurrent . configuration . should_receive ( :global_task_pool ) . and_return ( executor )
102+ Future . execute ( task : true ) { nil }
103+ end
93104
94- it 'uses the global task pool by default'
105+ it 'uses the global task pool by default' do
106+ Concurrent . configuration . should_receive ( :global_task_pool ) . and_return ( executor )
107+ Future . execute { nil }
108+ end
95109 end
96110
97111 context 'instance #execute' do
You can’t perform that action at this time.
0 commit comments