Sha256: af33e95f4abf286e9180ab4619451c4297923965fcbba5098e01e9caaf7601b0

Contents?: true

Size: 935 Bytes

Versions: 15

Compression:

Stored size: 935 Bytes

Contents

require 'spec_helper'

describe Blather::BlatherError do
  it 'is handled by :error' do
    Blather::BlatherError.new.handler_hierarchy.must_equal [: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.must_equal [:parse_error, :error]
  end

  it 'contains the error message' do
    @error.must_respond_to :message
    @error.message.must_equal '</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.must_equal [:unknown_response_error, :error]
  end

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

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
blather-0.6.2 spec/blather/errors_spec.rb
blather-0.6.1 spec/blather/errors_spec.rb
blather-0.6.0 spec/blather/errors_spec.rb
blather-0.5.12 spec/blather/errors_spec.rb
blather-0.5.11 spec/blather/errors_spec.rb
blather-0.5.10 spec/blather/errors_spec.rb
blather-0.5.9 spec/blather/errors_spec.rb
blather-0.5.8 spec/blather/errors_spec.rb
blather-0.5.7 spec/blather/errors_spec.rb
blather-0.5.6 spec/blather/errors_spec.rb
blather-0.5.4 spec/blather/errors_spec.rb
blather-0.5.3 spec/blather/errors_spec.rb
blather-0.5.2 spec/blather/errors_spec.rb
blather-0.5.0 spec/blather/errors_spec.rb
blather-0.4.16 spec/blather/errors_spec.rb