1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00
mperham--sidekiq/test/test_util.rb
Mike Perham 30bbd13a5e Update tests so they all run standalone successfully, like so:
for i in test/test_* ; do ruby $i; done
2018-12-03 14:09:26 -08:00

21 lines
480 B
Ruby

# frozen_string_literal: true
require_relative 'helper'
require 'sidekiq/util'
class TestUtil < Minitest::Test
class Helpers
include Sidekiq::Util
end
def test_event_firing
Sidekiq.options[:lifecycle_events][:startup] = [proc { raise "boom" }]
h = Helpers.new
h.fire_event(:startup)
Sidekiq.options[:lifecycle_events][:startup] = [proc { raise "boom" }]
assert_raises RuntimeError do
h.fire_event(:startup, reraise: true)
end
end
end