Sha256: 01339926bc924c7950ebd56dd726d6368d1108cb273d9291dfc004befdd1ce50

Contents?: true

Size: 934 Bytes

Versions: 22

Compression:

Stored size: 934 Bytes

Contents

require 'spec_helper'

describe Blather::BlatherError do
  it 'is handled by :error' do
    Blather::BlatherError.new.handler_hierarchy.should == [:error]
  end
end

describe 'Blather::ParseError' do
  before { @error = Blather::ParseError.new('</generate-parse-error>"') }

  it 'is registers with the handler hierarchy' do
    @error.handler_hierarchy.should == [:parse_error, :error]
  end

  it 'contains the error message' do
    @error.should respond_to :message
    @error.message.should == '</generate-parse-error>"'
  end
end

describe 'Blather::UnknownResponse' do
  before { @error = Blather::UnknownResponse.new(Blather::XMPPNode.new('foo-bar')) }

  it 'is registers with the handler hierarchy' do
    @error.handler_hierarchy.should == [:unknown_response_error, :error]
  end

  it 'holds on to a copy of the failure node' do
    @error.should respond_to :node
    @error.node.element_name.should == 'foo-bar'
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

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