Sha256: e892a81ec0fb897785ded80125a37a7be24cf443085c90615332572cbb4d313d

Contents?: true

Size: 637 Bytes

Versions: 28

Compression:

Stored size: 637 Bytes

Contents

require_relative '../../spec_helper'
require_lib 'reek/context/statement_counter'

RSpec.describe Reek::Context::StatementCounter do
  let(:counter) { described_class.new }

  describe '#increase_by' do
    it 'does not increase if passed a falsy value' do
      counter.increase_by(nil)
      expect(counter.value).to eq 0
    end

    it 'increase by the lengh of the passed in argument' do
      counter.increase_by([1, 2, 3])
      expect(counter.value).to eq 3
    end

    it 'accumulates increases' do
      counter.increase_by([1, 2, 3])
      counter.increase_by([1, 2, 3])
      expect(counter.value).to eq 6
    end
  end
end

Version data entries

28 entries across 26 versions & 2 rubygems

Version Path
reek-4.8.2 spec/reek/context/statement_counter_spec.rb
reek-4.8.1 spec/reek/context/statement_counter_spec.rb
reek-4.8.0 spec/reek/context/statement_counter_spec.rb
reek-4.7.3 spec/reek/context/statement_counter_spec.rb
reek-4.7.2 spec/reek/context/statement_counter_spec.rb
reek-4.7.1 spec/reek/context/statement_counter_spec.rb
reek-4.7.0 spec/reek/context/statement_counter_spec.rb
reek-4.6.2 spec/reek/context/statement_counter_spec.rb