Sha256: 13361b9f474706c458906b215761662959e2a2ad6f988ba8abc74949efbf5983

Contents?: true

Size: 878 Bytes

Versions: 22

Compression:

Stored size: 878 Bytes

Contents

require 'spec_helper'

def sasl_error_node(err_name = 'aborted')
  node = Blather::XMPPNode.new 'failure'
  node.namespace = Blather::SASLError::SASL_ERR_NS

  node << Blather::XMPPNode.new(err_name, node.document)
  node
end

describe Blather::SASLError do
  it 'can import a node' do
    Blather::SASLError.should respond_to :import
    e = Blather::SASLError.import sasl_error_node
    e.should be_kind_of Blather::SASLError
  end

  describe 'each XMPP SASL error type' do
    %w[ aborted
        incorrect-encoding
        invalid-authzid
        invalid-mechanism
        mechanism-too-weak
        not-authorized
        temporary-auth-failure
    ].each do |error_type|
      it "handles the name for #{error_type}" do
        e = Blather::SASLError.import sasl_error_node(error_type)
        e.name.should == error_type.gsub('-','_').to_sym
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
blather-1.2.0 spec/blather/errors/sasl_error_spec.rb
blather-1.1.4 spec/blather/errors/sasl_error_spec.rb
blather-1.1.3 spec/blather/errors/sasl_error_spec.rb
blather-1.1.2 spec/blather/errors/sasl_error_spec.rb
blather-1.1.1 spec/blather/errors/sasl_error_spec.rb
blather-1.1.0 spec/blather/errors/sasl_error_spec.rb
blather-1.0.0 spec/blather/errors/sasl_error_spec.rb
blather-0.8.8 spec/blather/errors/sasl_error_spec.rb
blather-0.8.7 spec/blather/errors/sasl_error_spec.rb
blather-0.8.6 spec/blather/errors/sasl_error_spec.rb
blather-0.8.5 spec/blather/errors/sasl_error_spec.rb
blather-0.8.4 spec/blather/errors/sasl_error_spec.rb
blather-0.8.3 spec/blather/errors/sasl_error_spec.rb
blather-0.8.2 spec/blather/errors/sasl_error_spec.rb
tp-blather-0.8.5 spec/blather/errors/sasl_error_spec.rb
tp-blather-0.8.4 spec/blather/errors/sasl_error_spec.rb
tp-blather-0.8.3 spec/blather/errors/sasl_error_spec.rb
tp-blather-0.8.2 spec/blather/errors/sasl_error_spec.rb
blather-0.8.1 spec/blather/errors/sasl_error_spec.rb
blather-0.8.0 spec/blather/errors/sasl_error_spec.rb