Sha256: 64c1d13c8d08c78f2e65978017c1ff72702403c0ce2c31d51dac44ddb9fbc3fa

Contents?: true

Size: 1.7 KB

Versions: 10

Compression:

Stored size: 1.7 KB

Contents

# Unit tests for Bandwidth::Bxml::Bxml
describe 'Bandwidth::Bxml::Bxml' do
  let(:instance) { Bandwidth::Bxml::Bxml.new }
  let(:pause_recording) { Bandwidth::Bxml::PauseRecording.new }

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

    it 'test initializing with a single nested verb' do
      instance = Bandwidth::Bxml::Bxml.new(pause_recording)
      expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Bxml>\n  <PauseRecording/>\n</Bxml>\n"
      expect(instance.to_bxml).to eq(expected)
    end

    it 'test initializing with multiple nested verbs' do
      instance = Bandwidth::Bxml::Bxml.new([pause_recording, pause_recording])
      expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Bxml>\n  <PauseRecording/>\n  <PauseRecording/>\n</Bxml>\n"
      expect(instance.to_bxml).to eq(expected)
    end

    it 'test adding a single verb to the Bxml instance' do
      instance.add_verbs(pause_recording)
      expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Bxml>\n  <PauseRecording/>\n</Bxml>\n"
      expect(instance.to_bxml).to eq(expected)
    end

    it 'test adding multiple verbs to the Bxml instance' do
      instance.add_verbs([pause_recording, pause_recording])
      expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Bxml>\n  <PauseRecording/>\n  <PauseRecording/>\n</Bxml>\n"
      expect(instance.to_bxml).to eq(expected)
    end

    it 'test the to_bxml method of the Bxml instance' do
      expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Bxml/>\n"
      expect(instance.to_bxml).to eq(expected)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
bandwidth-sdk-14.0.0 spec/unit/models/bxml/bxml_spec.rb
bandwidth-sdk-13.1.4 spec/unit/models/bxml/bxml_spec.rb
bandwidth-sdk-13.1.3 spec/unit/models/bxml/bxml_spec.rb
bandwidth-sdk-13.1.2 spec/unit/models/bxml/bxml_spec.rb
bandwidth-sdk-13.1.1 spec/unit/models/bxml/bxml_spec.rb
bandwidth-sdk-13.1.0 spec/unit/models/bxml/bxml_spec.rb
bandwidth-sdk-13.0.0 spec/unit/models/bxml/bxml_spec.rb
bandwidth-sdk-12.1.0 spec/unit/models/bxml/bxml_spec.rb
bandwidth-sdk-11.3.0 spec/models/bxml/bxml_spec.rb
bandwidth-sdk-11.2.0 spec/models/bxml/bxml_spec.rb