spec/limit_detectors_spec.rb
Block has too many lines. [35/25] Open
Open
describe '#at_least' do
it 'is false for an empty Array, if at least one is expected' do
expect(Kernel).to_not receive(:warn)
expect([].at_least?(1) { true }).to be_falsey
end
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Block has too many lines. [27/25] Open
Open
describe '#at_most' do
it 'is true for an empty Array' do
expect(Kernel).to_not receive(:warn)
expect([].at_most?(5) { true }).to be_truthy
expect([].at_most?(0) { true }).to be_truthy
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Line is too long. [93/80] Open
Open
it 'is true if all elements meet the criterion and the size is the given minimum number' do
- Exclude checks
Line is too long. [86/80] Open
Open
it('counts 4 odd numbers') { expect(subject.occurrences_of(&:odd?)).to be 4 }
- Exclude checks
Line is too long. [81/80] Open
Open
expect(Kernel).to receive(:warn).with(/'at_least'.+deprecated.+'at_least\?'/)
- Exclude checks
Line is too long. [110/80] Open
Open
expect { object.at_most?(1, &:condition?) }.to raise_exception(NoMethodError, /undefined method .inject./)
- Exclude checks
Line is too long. [93/80] Open
Open
it 'is true if all elements meet the criterion and the size is the given maximum number' do
- Exclude checks
Line is too long. [87/80] Open
Open
it('counts 3 even numbers') { expect(subject.occurrences_of(&:even?)).to be 3 }
- Exclude checks
Line is too long. [114/80] Open
Open
expect { subject.at_most?(1) { raise ArgumentError, 'BoomError' } }.to raise_error(ArgumentError, 'BoomError')
- Exclude checks
Line is too long. [102/80] Open
Open
expect(obj.occurrences_of { true }).to be(0), "Expected to count 0, for an empty #{obj.class}"
- Exclude checks
Line is too long. [92/80] Open
Open
it('counts 7 positive numbers') { expect(subject.occurrences_of { |e| e > 0 }).to be 7 }
- Exclude checks
Line is too long. [117/80] Open
Open
expect { subject.occurrences_of { raise ArgumentError, 'BoomError' } }.to raise_error(ArgumentError, 'BoomError')
- Exclude checks
Line is too long. [92/80] Open
Open
it('counts no number < 0') { expect(subject.occurrences_of { |e| e < 0 }).to be 0 }
- Exclude checks