Sha256: 17c8284c8034af6800975225dd3964551d92397963bb7ffb2378460391caf4fb

Contents?: true

Size: 1.16 KB

Versions: 9

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

module Punchblock
  module Command
    describe Join do

      it 'registers itself' do
        RayoNode.class_from_registration(:join, 'urn:xmpp:rayo:1').should == Join
      end

      describe "when setting options in initializer" do
        subject { Join.new :other_call_id => 'abc123', :mixer_name => 'blah', :direction => :duplex, :media => :bridge }

        its(:other_call_id) { should == 'abc123' }
        its(:mixer_name)    { should == 'blah' }
        its(:direction)     { should == :duplex }
        its(:media)         { should == :bridge }
      end

      describe "from a stanza" do
        let :stanza do
          <<-MESSAGE
<join xmlns="urn:xmpp:rayo:1"
      call-id="abc123"
      mixer-name="blah"
      direction="duplex"
      media="bridge" />
          MESSAGE
        end

        subject { RayoNode.import parse_stanza(stanza).root, '9f00061', '1' }

        it { should be_instance_of Join }

        its(:other_call_id) { should == 'abc123' }
        its(:mixer_name)    { should == 'blah' }
        its(:direction)     { should == :duplex }
        its(:media)         { should == :bridge }
      end
    end
  end
end # Punchblock

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
punchblock-0.9.2 spec/punchblock/command/join_spec.rb
punchblock-0.9.1 spec/punchblock/command/join_spec.rb
punchblock-0.9.0 spec/punchblock/command/join_spec.rb
punchblock-0.8.4 spec/punchblock/command/join_spec.rb
punchblock-0.8.3 spec/punchblock/command/join_spec.rb
punchblock-0.8.2 spec/punchblock/command/join_spec.rb
punchblock-0.8.1 spec/punchblock/command/join_spec.rb
punchblock-0.8.0 spec/punchblock/command/join_spec.rb
punchblock-0.7.2 spec/punchblock/command/join_spec.rb