test/test_scheduled.rb in sidekiq-4.0.2 vs test/test_scheduled.rb in sidekiq-4.1.0
- old
+ new
@@ -88,10 +88,10 @@
end
it 'generates random intervals that target a configured average' do
with_sidekiq_option(:poll_interval_average, 10) do
i = 500
- intervals = i.times.map{ @poller.send(:random_poll_interval) }
+ intervals = Array.new(i){ @poller.send(:random_poll_interval) }
assert intervals.all?{|x| x >= 5}
assert intervals.all?{|x| x <= 15}
assert_in_delta 10, intervals.reduce(&:+).to_f / i, 0.5
end