Sha256: f63e151ad1f00f4e11e8db749bf2a62de3f4d60166701b60462859338ab9a3e5

Contents?: true

Size: 1011 Bytes

Versions: 10

Compression:

Stored size: 1011 Bytes

Contents

require 'spec_helper'
require 'adhearsion/voip/freeswitch/basic_connection_manager'

include Adhearsion::VoIP::FreeSwitch

describe "FreeSwitch BasicConnectionManager" do
  attr_reader :manager, :io
  before(:each) do
    @io      = StringIO.new
    @manager = BasicConnectionManager.new io
  end

  it "<<() should add two newlines" do
    manager << "foobar"
    io.string.should == "foobar\n\n"
  end

end

describe "FreeSwitch BasicConnectionManager's header parser" do
  it "YAML-like headers are read properly" do
    header = {
      "Foo-Bar"                  => "bar",
      "Qaz-Monkey-Charlie-Zebra" => "qwerty"
    }

    string_header = header.inject("") do |string, (key, value)|
      string + "#{key}: #{value}\n"
    end

    string_header << "\n"

    manager = BasicConnectionManager.new StringIO.new(string_header)
    manager.get_raw_header.should == string_header.strip

    manager = BasicConnectionManager.new StringIO.new(string_header)
    manager.get_header.should == header
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
adhearsion-1.2.6 spec/adhearsion/voip/freeswitch/basic_connection_manager_spec.rb
adhearsion-1.2.5 spec/adhearsion/voip/freeswitch/basic_connection_manager_spec.rb
adhearsion-1.2.4 spec/adhearsion/voip/freeswitch/basic_connection_manager_spec.rb
adhearsion-1.2.3 spec/adhearsion/voip/freeswitch/basic_connection_manager_spec.rb
adhearsion-1.2.1 spec/adhearsion/voip/freeswitch/basic_connection_manager_spec.rb
adhearsion-1.2.0 spec/adhearsion/voip/freeswitch/basic_connection_manager_spec.rb
adhearsion-1.1.1 spec/voip/freeswitch/basic_connection_manager_spec.rb
adhearsion-1.1.0 spec/voip/freeswitch/basic_connection_manager_spec.rb
adhearsion-1.0.3 spec/voip/freeswitch/basic_connection_manager_spec.rb
adhearsion-1.0.2 spec/voip/freeswitch/basic_connection_manager_spec.rb