Sha256: bef6ce7e0972dc904eba252e406d2fc28751b932d5200e62d4e13dd626fbf8e3
Contents?: true
Size: 687 Bytes
Versions: 9
Compression:
Stored size: 687 Bytes
Contents
RSpec.describe WorkerKiller::CountLimiter do subject{ described_class.new(**options) } let(:min){ rand(50..100) } let(:max){ min + rand(100) } let(:options){ { min: min, max: max, verbose: true } } it { is_expected.to have_attributes(min: min, max: max, limit: a_value_between(min, max), left: subject.limit) } it 'expect not to react while less than limit' do (subject.limit - 1).times do expect(subject.check).to be_falsey end end it 'expect call reaction when check succeded' do (subject.limit - 1).times do expect(subject.check).to be_falsey end expect(subject.check).to be_truthy expect(subject.check).to be_truthy end end
Version data entries
9 entries across 9 versions & 1 rubygems