s2k/limit_detectors

View on GitHub
spec/limit_detectors_spec.rb

Summary

Maintainability
A
0 mins
Test Coverage

Block has too many lines. [35/25]
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
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

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

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
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

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

  it 'is true if all elements meet the criterion and the size is the given minimum number' do
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

Line is too long. [86/80]
Open

    it('counts 4 odd numbers')      { expect(subject.occurrences_of(&:odd?)).to be 4 }
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

Line is too long. [81/80]
Open

    expect(Kernel).to receive(:warn).with(/'at_least'.+deprecated.+'at_least\?'/)
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

Line is too long. [110/80]
Open

    expect { object.at_most?(1, &:condition?) }.to raise_exception(NoMethodError, /undefined method .inject./)
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

Line is too long. [93/80]
Open

  it 'is true if all elements meet the criterion and the size is the given maximum number' do
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

Line is too long. [87/80]
Open

    it('counts 3 even numbers')     { expect(subject.occurrences_of(&:even?)).to be 3 }
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

Line is too long. [114/80]
Open

    expect { subject.at_most?(1) { raise ArgumentError, 'BoomError' } }.to raise_error(ArgumentError, 'BoomError')
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

Line is too long. [102/80]
Open

        expect(obj.occurrences_of { true }).to be(0), "Expected to count 0, for an empty #{obj.class}"
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

Line is too long. [92/80]
Open

    it('counts 7 positive numbers') { expect(subject.occurrences_of { |e| e > 0 }).to be 7 }
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

Line is too long. [117/80]
Open

    expect { subject.occurrences_of { raise ArgumentError, 'BoomError' } }.to raise_error(ArgumentError, 'BoomError')
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

Line is too long. [92/80]
Open

    it('counts no number < 0')      { expect(subject.occurrences_of { |e| e < 0 }).to be 0 }
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

There are no issues that match your filters.

Category
Status