Skip to content

Commit b77520e

Browse files
committed
Do not test integration with ErlangActor when not available
1 parent 2484bf1 commit b77520e

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

spec/concurrent/promises_spec.rb

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ def behaves_as_delay(delay, value)
521521
v += 1
522522
v < 5 ? [future(v, &body)] : v
523523
end
524-
expect(future(0, &body).run(-> v { v.first if v.is_a? Array}).value!).to eq 5
524+
expect(future(0, &body).run(-> v { v.first if v.is_a? Array }).value!).to eq 5
525525
end
526526

527527
it 'can be risen when rejected' do
@@ -692,15 +692,17 @@ def behaves_as_delay(delay, value)
692692
value!).to eq 6
693693
end
694694

695-
it 'with erlang actor' do
696-
actor = Concurrent::ErlangActor.spawn :on_thread do
697-
reply receive * 2
698-
end
695+
if Concurrent.const_defined? :ErlangActor
696+
it 'with erlang actor' do
697+
actor = Concurrent::ErlangActor.spawn :on_thread do
698+
reply receive * 2
699+
end
699700

700-
expect(future { 2 }.
701-
then_ask(actor).
702-
then { |v| v + 2 }.
703-
value!).to eq 6
701+
expect(future { 2 }.
702+
then_ask(actor).
703+
then { |v| v + 2 }.
704+
value!).to eq 6
705+
end
704706
end
705707

706708
it 'with channel' do

0 commit comments

Comments
 (0)