Sha256: 509664f523a4f44a8599e7b02656528157c15300418c3ffd46c5269175c779ac

Contents?: true

Size: 976 Bytes

Versions: 13

Compression:

Stored size: 976 Bytes

Contents

require File.join(File.dirname(__FILE__), *%w[.. spec_helper])

describe Blather::BlatherError do
  it 'is handled by :error' do
    Blather::BlatherError.new.handler_heirarchy.must_equal [:error]
  end
end

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

  it 'is registers with the handler heirarchy' do
    @error.handler_heirarchy.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 heirarchy' do
    @error.handler_heirarchy.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

13 entries across 13 versions & 2 rubygems

Version Path
sprsquish-blather-0.4.0 spec/blather/errors_spec.rb
sprsquish-blather-0.4.1 spec/blather/errors_spec.rb
sprsquish-blather-0.4.2 spec/blather/errors_spec.rb
sprsquish-blather-0.4.3 spec/blather/errors_spec.rb
sprsquish-blather-0.4.4 spec/blather/errors_spec.rb
blather-0.4.7 spec/blather/errors_spec.rb
blather-0.4.6 spec/blather/errors_spec.rb
blather-0.4.5 spec/blather/errors_spec.rb
blather-0.4.4 spec/blather/errors_spec.rb
blather-0.4.3 spec/blather/errors_spec.rb
blather-0.4.0 spec/blather/errors_spec.rb
blather-0.4.1 spec/blather/errors_spec.rb
blather-0.4.2 spec/blather/errors_spec.rb