Sha256: 4c07ad90755758dc22ee7bf3bcd8b1b8a718438fd3749d80a0d2691912fcd277

Contents?: true

Size: 1.19 KB

Versions: 8

Compression:

Stored size: 1.19 KB

Contents

# encoding: utf-8
require 'spec_helper'

module RubyAMI
  describe Response do
    describe "equality" do
      context "with the same headers" do
        let :event1 do
          Response.new.tap do |e|
            e['Channel'] = 'SIP/101-3f3f'
            e['Uniqueid'] = '1094154427.10'
            e['Cause'] = '0'
          end
        end

        let :event2 do
          Response.new.tap do |e|
            e['Channel'] = 'SIP/101-3f3f'
            e['Uniqueid'] = '1094154427.10'
            e['Cause'] = '0'
          end
        end

        it "should be equal" do
          event1.should be == event2
        end
      end

      context "with different headers" do
        let :event1 do
          Response.new.tap do |e|
            e['Channel'] = 'SIP/101-3f3f'
            e['Uniqueid'] = '1094154427.10'
            e['Cause'] = '0'
          end
        end

        let :event2 do
          Response.new.tap do |e|
            e['Channel'] = 'SIP/101-3f3f'
            e['Uniqueid'] = '1094154427.10'
            e['Cause'] = '1'
          end
        end

        it "should not be equal" do
          event1.should_not be == event2
        end
      end
    end
  end # Response
end # RubyAMI

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ruby_ami-1.3.4 spec/ruby_ami/response_spec.rb
ruby_ami-1.3.3 spec/ruby_ami/response_spec.rb
ruby_ami-1.3.2 spec/ruby_ami/response_spec.rb
ruby_ami-1.3.1 spec/ruby_ami/response_spec.rb
ruby_ami-1.3.0 spec/ruby_ami/response_spec.rb
ruby_ami-1.2.6 spec/ruby_ami/response_spec.rb
ruby_ami-1.2.5 spec/ruby_ami/response_spec.rb
ruby_ami-1.2.4 spec/ruby_ami/response_spec.rb