spec/adhearsion/punchblock_plugin_spec.rb in adhearsion-2.0.0.beta1 vs spec/adhearsion/punchblock_plugin_spec.rb in adhearsion-2.0.0.rc1
- old
+ new
@@ -1,5 +1,7 @@
+# encoding: utf-8
+
require 'spec_helper'
module Adhearsion
describe PunchblockPlugin do
it "should make the client accessible from the Initializer" do
@@ -18,15 +20,16 @@
flexmock message, :execute! => true
message.response = response
end
it "writes a command to the client" do
- flexmock(PunchblockPlugin.client).should_receive(:execute_command).once.with(message)
+ flexmock(PunchblockPlugin.client).should_receive(:execute_command).once.with(message, :async => true)
PunchblockPlugin.execute_component message
end
it "blocks until a response is received" do
slow_command = Punchblock::Command::Dial.new
+ slow_command.request!
Thread.new do
sleep 0.5
slow_command.response = response
end
starting_time = Time.now