spec/punchblock/translator/asterisk/component/mrcp_prompt_spec.rb in punchblock-2.4.2 vs spec/punchblock/translator/asterisk/component/mrcp_prompt_spec.rb in punchblock-2.5.0

- old
+ new

@@ -566,15 +566,47 @@ describe 'Input#recognizer' do pending end describe 'Input#sensitivity' do - pending + context 'a string' do + let(:input_command_opts) { { sensitivity: '0.2' } } + + it 'should pass the sl option to SynthAndRecog' do + expect_synthandrecog_with_options(/sl=0.2/) + subject.execute + end + end + + context 'unset' do + let(:input_command_opts) { { sensitivity: nil } } + + it 'should not pass any options to SynthAndRecog' do + expect_synthandrecog_with_options(//) + subject.execute + end + end end describe 'Input#min-confidence' do - pending + context 'a string' do + let(:input_command_opts) { { min_confidence: '0.5' } } + + it 'should pass the ct option to SynthAndRecog' do + expect_synthandrecog_with_options(/ct=0.5/) + subject.execute + end + end + + context 'unset' do + let(:input_command_opts) { { min_confidence: nil } } + + it 'should not pass any options to SynthAndRecog' do + expect_synthandrecog_with_options(//) + subject.execute + end + end end describe 'Input#max-silence' do pending end @@ -582,10 +614,26 @@ describe 'Input#match-content-type' do pending end describe 'Input#language' do - pending + context 'a string' do + let(:input_command_opts) { { language: 'en-GB' } } + + it 'should pass the spl option to SynthAndRecog' do + expect_synthandrecog_with_options(/spl=en-GB/) + subject.execute + end + end + + context 'unset' do + let(:input_command_opts) { { language: nil } } + + it 'should not pass any options to SynthAndRecog' do + expect_synthandrecog_with_options(//) + subject.execute + end + end end describe "#execute_command" do context "with a command it does not understand" do let(:command) { Punchblock::Component::Output::Pause.new }