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-6.0.3 spec/reek/context/statement_counter_spec.rb
reek-6.0.2 spec/reek/context/statement_counter_spec.rb
reek-6.0.1 spec/reek/context/statement_counter_spec.rb
reek-6.0.0 spec/reek/context/statement_counter_spec.rb
reek-5.6.0 spec/reek/context/statement_counter_spec.rb
reek-5.5.0 spec/reek/context/statement_counter_spec.rb
reek-5.4.1 spec/reek/context/statement_counter_spec.rb
reek-5.4.0 spec/reek/context/statement_counter_spec.rb
reek-5.3.2 spec/reek/context/statement_counter_spec.rb
reek-5.3.1 spec/reek/context/statement_counter_spec.rb
reek-5.3.0 spec/reek/context/statement_counter_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/context/statement_counter_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/context/statement_counter_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/context/statement_counter_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/spec/reek/context/statement_counter_spec.rb
reek-5.2.0 spec/reek/context/statement_counter_spec.rb
reek-5.1.0 spec/reek/context/statement_counter_spec.rb
reek-5.0.2 spec/reek/context/statement_counter_spec.rb
reek-5.0.1 spec/reek/context/statement_counter_spec.rb
reek-5.0.0 spec/reek/context/statement_counter_spec.rb