Sha256: bec5746c40055e6c695e36d20e8f2094db090f088b4eb0487ed8373d57b5aa61
Contents?: true
Size: 1.21 KB
Versions: 7
Compression:
Stored size: 1.21 KB
Contents
# encoding: utf-8 require 'spec_helper' module Rubocop module Cop module Style 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 end
Version data entries
7 entries across 7 versions & 2 rubygems