Sha256: 22f2744986a2c0c472f1ce4a0bf800062743035473b670dc7cb69efbf55547f4
Contents?: true
Size: 699 Bytes
Versions: 4
Compression:
Stored size: 699 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, ['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, ['x = :a']) expect(space.offences.map(&:message)).to be_empty end it 'allows colons in strings' do inspect_source(space, ["str << ':'"]) expect(space.offences.map(&:message)).to be_empty end end end end
Version data entries
4 entries across 4 versions & 1 rubygems