Sha256: cbe1faf7fde677dd35bd158f070e4e09c22e853fb28b87553c781d4398e90bbf

Contents?: true

Size: 740 Bytes

Versions: 11

Compression:

Stored size: 740 Bytes

Contents

require "test_helper"

# To allow sidekiq error handlers to be registered, sidekiq must be in
# "server mode". This mode is triggered by loading sidekiq/cli. Note this
# has to be loaded before exception_notification/sidekiq.
require "sidekiq/cli"

require "exception_notification/sidekiq"

class MockSidekiqServer
  include ::Sidekiq::ExceptionHandler
end

class SidekiqTest < ActiveSupport::TestCase
  test "should call notify_exception when sidekiq raises an error" do
    server = MockSidekiqServer.new
    message = Hash.new
    exception = RuntimeError.new

    ExceptionNotifier.expects(:notify_exception).with(
      exception,
      :data => { :sidekiq => message }
    )

    server.handle_exception(exception, message)
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
exception_notification-4.2.0 test/exception_notifier/sidekiq_test.rb
exception_notification-4.2.0.rc1 test/exception_notifier/sidekiq_test.rb
exception_notification_more_info-1.0.1 test/exception_notifier/sidekiq_test.rb
exception_notification_more_info-1.0.0 test/exception_notifier/sidekiq_test.rb
exception_notification-4.1.4 test/exception_notifier/sidekiq_test.rb
exception_notification-4.1.3 test/exception_notifier/sidekiq_test.rb
exception_notification-4.1.2 test/exception_notifier/sidekiq_test.rb
exception_notification-4.1.1 test/exception_notifier/sidekiq_test.rb
exception_notification-4.1.0 test/exception_notifier/sidekiq_test.rb
exception_notification-4.1.0.rc2 test/exception_notifier/sidekiq_test.rb
exception_notification-4.1.0.rc1 test/exception_notifier/sidekiq_test.rb