Sha256: 10a5cc879718a7bdd5b0632da40e24b05d585b36f604642ef16e11a3530c9274

Contents?: true

Size: 538 Bytes

Versions: 4

Compression:

Stored size: 538 Bytes

Contents

require 'spec_helper'

describe FluQ::Mixins::Logger do

  subject do
    logger = Logger.new("/dev/null")
    logger.extend described_class
    logger
  end

  its(:exception_handlers) { should == [] }

  it 'should register handlers' do
    subject.exception_handler {|*| }
    subject.should have(1).exception_handlers
  end

  it 'should apply handlers on crash' do
    str = ""
    subject.exception_handler {|ex| str << ex.message }
    subject.crash("error", StandardError.new("something"))
    str.should == "something"
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fluq-0.7.5 spec/fluq/mixins/logger_spec.rb
fluq-0.7.3 spec/fluq/mixins/logger_spec.rb
fluq-0.7.1 spec/fluq/mixins/logger_spec.rb
fluq-0.7.0 spec/fluq/mixins/logger_spec.rb