Sha256: 3daf79d7e49af58f87dfe02255c6304a6c0297d73dadb1d5b51850529f1ed552
Contents?: true
Size: 732 Bytes
Versions: 13
Compression:
Stored size: 732 Bytes
Contents
# encoding: utf-8 require 'spec_helper' module Rubocop module Cop describe SpaceAfterColon do let(:space) { SpaceAfterColon.new } it 'registers an offence for colon without space after it' do inspect_source(space, 'file.rb', ['x = w ? {a:3}:4']) expect(space.offences.map(&:message)).to eq( ['Space missing after colon.'] * 2) end it 'allows the colons in symbols' do inspect_source(space, 'file.rb', ['x = :a']) expect(space.offences.map(&:message)).to be_empty end it 'allows colons in strings' do inspect_source(space, 'file.rb', ["str << ':'"]) expect(space.offences.map(&:message)).to be_empty end end end end
Version data entries
13 entries across 13 versions & 1 rubygems