Skip to content

Commit 85763d2

Browse files
committed
Few more tests
1 parent bf54691 commit 85763d2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

spec/concurrent/promises_spec.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929

3030
future = fulfilled_future(1).then { |v| v + 1 }
3131
expect(future.value!).to eq 2
32+
33+
future = future(1, 2, &-> v { v })
34+
expect { future.value! }.to raise_error ArgumentError, /wrong number of arguments/
35+
36+
future = fulfilled_future(1).then(2, &-> v { v })
37+
expect { future.value! }.to raise_error ArgumentError, /wrong number of arguments/
3238
end
3339

3440
it 'executes with args' do
@@ -675,7 +681,7 @@ def behaves_as_delay(delay, value)
675681
end
676682

677683
describe 'interoperability' do
678-
it 'with actor', if: !defined?(JRUBY_VERSION) do
684+
it 'with processing actor', if: !defined?(JRUBY_VERSION) do
679685
actor = Concurrent::Actor::Utils::AdHoc.spawn :doubler do
680686
-> v { v * 2 }
681687
end
@@ -700,6 +706,10 @@ def behaves_as_delay(delay, value)
700706
expect(result.value!).to eq '02'
701707
end
702708
end
709+
710+
specify 'zip_futures_over' do
711+
expect(zip_futures_over([1, 2]) { |v| v.succ }.value!).to eq [2, 3]
712+
end
703713
end
704714

705715
RSpec.describe 'Concurrent::ProcessingActor' do

0 commit comments

Comments
 (0)