spec/punchblock/translator/asterisk/component/output_spec.rb in punchblock-1.5.1 vs spec/punchblock/translator/asterisk/component/output_spec.rb in punchblock-1.5.2
- old
+ new
@@ -160,9 +160,25 @@
it "should execute MRCPSynth" do
mock_call.expects(:send_agi_action!).once.with 'EXEC MRCPSynth', ssml_doc.to_s.squish.gsub(/["\\]/) { |m| "\\#{m}" }, ''
subject.execute
end
+ context "when the SSML document contains commas" do
+ let :ssml_doc do
+ RubySpeech::SSML.draw do
+ string "this, here, is a test"
+ end
+ end
+
+ it 'should escape TTS strings containing a comma' do
+ mock_call.expects(:send_agi_action!).once.with do |*args|
+ args[0].should be == 'EXEC MRCPSynth'
+ args[1].should match(/this\\, here\\, is a test/)
+ end
+ subject.execute
+ end
+ end
+
it 'should send a complete event when MRCPSynth completes' do
def mock_call.send_agi_action!(*args, &block)
block.call Punchblock::Component::Asterisk::AGI::Command::Complete::Success.new(:code => 200, :result => 1)
end
subject.execute