spec/adhearsion/call_controller/dial_spec.rb in adhearsion-2.4.0.beta2 vs spec/adhearsion/call_controller/dial_spec.rb in adhearsion-2.4.0.beta3
- old
+ new
@@ -476,13 +476,13 @@
latch.countdown!
end
sleep 0.5
- other_mock_call << mock_end
- second_root_call << mock_end
- second_other_mock_call << mock_end
+ other_mock_call.async << mock_end
+ second_root_call.async << mock_end
+ second_other_mock_call.async << mock_end
latch.wait(1).should be_true
waiter_thread.join
dial.status.result.should be == :answer
@@ -497,13 +497,13 @@
latch.countdown!
end
sleep 0.5
- other_mock_call << mock_end
- second_root_call << mock_end
- second_other_mock_call << mock_end
+ other_mock_call.async << mock_end
+ second_root_call.async << mock_end
+ second_other_mock_call.async << mock_end
latch.wait(1).should be_true
waiter_thread.join
dial.status.result.should be == :answer
@@ -578,13 +578,13 @@
latch.countdown!
end
sleep 0.5
- other_mock_call << mock_end
- second_root_call << mock_end
- second_other_mock_call << mock_end
+ other_mock_call.async << mock_end
+ second_root_call.async << mock_end
+ second_other_mock_call.async << mock_end
latch.wait(1).should be_true
waiter_thread.join
dial.status.result.should be == :answer
@@ -991,11 +991,13 @@
other_mock_call['confirm'] = true
call.should_receive(:answer).once
other_mock_call.should_receive(:dial).once.with(to, from: nil)
other_mock_call.should_receive(:join).once.with(call)
- other_mock_call.should_receive(:hangup).once
+ other_mock_call.should_receive(:hangup).once.and_return do
+ other_mock_call << mock_end
+ end
second_other_mock_call.should_receive(:dial).once.with(second_to, from: nil)
second_other_mock_call.should_receive(:join).never
second_other_mock_call.should_receive(:execute_controller).never
second_other_mock_call.should_receive(:hangup).once.and_return do
@@ -1008,11 +1010,10 @@
other_mock_call << mock_answered
confirmation_latch.wait(1).should be_true
other_mock_call << Punchblock::Event::Unjoined.new(call_uri: call.id)
- other_mock_call << mock_end
latch.wait(2).should be_true
t.join
status = t.value
@@ -1474,13 +1475,13 @@
latch.countdown!
end
sleep 0.5
- other_mock_call << mock_end
- second_root_call << mock_end
- second_other_mock_call << mock_end
+ other_mock_call.async << mock_end
+ second_root_call.async << mock_end
+ second_other_mock_call.async << mock_end
latch.wait(1).should be_true
waiter_thread.join
dial.status.result.should be == :answer
@@ -1495,13 +1496,13 @@
latch.countdown!
end
sleep 0.5
- other_mock_call << mock_end
- second_root_call << mock_end
- second_other_mock_call << mock_end
+ other_mock_call.async << mock_end
+ second_root_call.async << mock_end
+ second_other_mock_call.async << mock_end
latch.wait(1).should be_true
waiter_thread.join
dial.status.result.should be == :answer
@@ -1576,12 +1577,12 @@
latch.countdown!
end
sleep 0.5
- other_mock_call << mock_end
- second_root_call << mock_end
- second_other_mock_call << mock_end
+ other_mock_call.async << mock_end
+ second_root_call.async << mock_end
+ second_other_mock_call.async << mock_end
latch.wait(1).should be_true
waiter_thread.join
dial.status.result.should be == :answer