Sha256: f369385f5035fe0d35e37e6140c2f48d0b70f7250c3408d98685fda9deec1f5b

Contents?: true

Size: 633 Bytes

Versions: 4

Compression:

Stored size: 633 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

module Rubocop
  module Cop
    describe ParameterLists do
      let(:list) { ParameterLists.new }

      it 'registers an offence for a method def with 5 parameters' do
        inspect_source(list, ['def meth(a, b, c, d, e)',
                              'end'])
        expect(list.messages).to eq(
          ['Avoid parameter lists longer than 4 parameters.'])
      end

      it 'accepts a method def with 4 parameters' do
        inspect_source(list, ['def meth(a, b, c, d)',
                              'end'])
        expect(list.offences).to be_empty
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubocop-0.8.3 spec/rubocop/cops/parameter_lists_spec.rb
rubocop-0.8.2 spec/rubocop/cops/parameter_lists_spec.rb
rubocop-0.8.1 spec/rubocop/cops/parameter_lists_spec.rb
rubocop-0.8.0 spec/rubocop/cops/parameter_lists_spec.rb