Sha256: acccae24f5c516328917e3b992ab8d644ef402ef05b6c7e595e94476a80908c4
Contents?: true
Size: 1.11 KB
Versions: 4
Compression:
Stored size: 1.11 KB
Contents
# encoding: utf-8 require 'spec_helper' module Rubocop module Cop describe SymbolArray do let(:sa) { SymbolArray.new } it 'registers an offence for arrays of symbols', { ruby: 2.0 } do inspect_source(sa, ['[:one, :two, :three]']) expect(sa.offences.size).to eq(1) end it 'does not reg an offence for array with non-syms', { ruby: 2.0 } do inspect_source(sa, ['[:one, :two, "three"]']) expect(sa.offences).to be_empty end it 'does not reg an offence for array starting with %i', { ruby: 2.0 } do inspect_source(sa, ['%i(one two three)']) expect(sa.offences).to be_empty end it 'does not reg an offence for array with one element', { ruby: 2.0 } do inspect_source(sa, ['[:three]']) expect(sa.offences).to be_empty end it 'does nothing on Ruby 1.9', { ruby: 1.9 } do inspect_source(sa, ['[:one, :two, :three]']) expect(sa.offences).to be_empty end end end end
Version data entries
4 entries across 4 versions & 1 rubygems