Sha256: 09590cf4de537c95a4d9eb03a092444f9972713daa7cecadd2aff0590e1cd364

Contents?: true

Size: 639 Bytes

Versions: 38

Compression:

Stored size: 639 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe DaemonKit::Safety do
end

describe DaemonKit::ErrorHandlers::Mail do
  it "should send an email report" do
    conf = Object.new
    conf.stubs(:daemon_name).returns('test')
    DaemonKit.stubs(:configuration).returns(conf)

    fake_smtp = Object.new
    fake_smtp.expects(:start).with('localhost.localdomain', nil, nil, nil)
    Net::SMTP.expects(:new).with('localhost', 25).returns(fake_smtp)

    begin
      raise RuntimeError, "specs don't fail :)"
    rescue => e
      handler = DaemonKit::ErrorHandlers::Mail.instance
      handler.handle_exception( e )
    end
  end
end

Version data entries

38 entries across 38 versions & 7 rubygems

Version Path
kennethkalmer-daemon-kit-0.1.7.10 spec/error_handlers_spec.rb
kennethkalmer-daemon-kit-0.1.7.4 spec/error_handlers_spec.rb
kennethkalmer-daemon-kit-0.1.7.5 spec/error_handlers_spec.rb
kennethkalmer-daemon-kit-0.1.7.7 spec/error_handlers_spec.rb
kennethkalmer-daemon-kit-0.1.7.8 spec/error_handlers_spec.rb
kennethkalmer-daemon-kit-0.1.7.9 spec/error_handlers_spec.rb
queso-daemon-kit-0.1.7.10 spec/error_handlers_spec.rb
skaar-daemon-kit-0.1.7.10 spec/error_handlers_spec.rb
amqp-daemon-kit-1.0.1 spec/error_handlers_spec.rb
amqp-daemon-kit-0.1.8.2 spec/error_handlers_spec.rb
amqp-daemon-kit-0.1.8.1 spec/error_handlers_spec.rb
daemon-kit-0.1.8.1 spec/error_handlers_spec.rb
daemon-kit-0.1.8 spec/error_handlers_spec.rb
daemon-kit-0.1.8rc3 spec/error_handlers_spec.rb
textgoeshere-daemon-kit-0.1.8.31 spec/error_handlers_spec.rb
textgoeshere-daemon-kit-0.1.8rc3 spec/error_handlers_spec.rb
daemon-kit-0.1.8rc2 spec/error_handlers_spec.rb
daemon-kit-0.1.8rc1 spec/error_handlers_spec.rb
apphunkd-0.13.0 vendor/daemon_kit/spec/error_handlers_spec.rb
apphunkd-0.12.2 vendor/daemon_kit/spec/error_handlers_spec.rb