Sha256: f3a470d2518ff5c0b8a93cff628471555311ff656773d8e841bf5e16ab325c33

Contents?: true

Size: 1.37 KB

Versions: 14

Compression:

Stored size: 1.37 KB

Contents

# Unit tests for Bandwidth::Bxml::SpeakSentence
describe 'Bandwidth::Bxml::SpeakSentence' do
  let(:initial_attributes) {
    {
      voice: 'julie',
      gender: 'female',
      locale: 'en_US'
    }
  }

  let(:new_attributes) {
    {
      voice: 'simon',
      gender: 'male',
      locale: 'en_UK'
    }
  }

  let(:instance) { Bandwidth::Bxml::SpeakSentence.new('<lang xml:lang="es-MX">Hola</lang>ruby speak sentence <emphasis>SSML test</emphasis>', initial_attributes) }

  describe 'test an instance of SpeakSentence' do
    it 'validates instance of SpeakSentence' do
      expect(instance).to be_instance_of(Bandwidth::Bxml::SpeakSentence)
      expect(instance).to be_a(Bandwidth::Bxml::Verb)
    end

    it 'tests the to_bxml method of the SpeakSentence instance' do
      expected = "\n<SpeakSentence voice=\"julie\" gender=\"female\" locale=\"en_US\"><lang xml:lang=\"es-MX\">Hola</lang>ruby speak sentence <emphasis>SSML test</emphasis></SpeakSentence>\n"
      expect(instance.to_bxml).to eq(expected)
    end

    it 'tests the set_attributes method of the SpeakSentence instance' do
      instance.set_attributes(new_attributes)
      expected = "\n<SpeakSentence voice=\"simon\" gender=\"male\" locale=\"en_UK\"><lang xml:lang=\"es-MX\">Hola</lang>ruby speak sentence <emphasis>SSML test</emphasis></SpeakSentence>\n"
      expect(instance.to_bxml).to eq(expected)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
bandwidth-sdk-13.1.2 spec/unit/models/bxml/verbs/speak_sentence_spec.rb
bandwidth-sdk-13.1.1 spec/unit/models/bxml/verbs/speak_sentence_spec.rb
bandwidth-sdk-13.1.0 spec/unit/models/bxml/verbs/speak_sentence_spec.rb
bandwidth-sdk-13.0.0 spec/unit/models/bxml/verbs/speak_sentence_spec.rb
bandwidth-sdk-12.1.0 spec/unit/models/bxml/verbs/speak_sentence_spec.rb
bandwidth-sdk-11.3.0 spec/models/bxml/verbs/speak_sentence_spec.rb
bandwidth-sdk-11.2.0 spec/models/bxml/verbs/speak_sentence_spec.rb
bandwidth-sdk-11.1.1 spec/models/bxml/verbs/speak_sentence_spec.rb
bandwidth-sdk-11.1.0 spec/models/bxml/verbs/speak_sentence_spec.rb
bandwidth-sdk-11.0.0 spec/models/bxml/verbs/speak_sentence_spec.rb
bandwidth-sdk-11.0.0.pre.beta.4.0 spec/models/bxml/verbs/speak_sentence_spec.rb
bandwidth-sdk-11.0.0.pre.beta.3.1 spec/models/bxml/verbs/speak_sentence_spec.rb
bandwidth-sdk-11.0.0.pre.beta.3.0 spec/models/bxml/verbs/speak_sentence_spec.rb
bandwidth-sdk-11.0.0.pre.beta.2.0 spec/models/bxml/verbs/speak_sentence_spec.rb