Sha256: 79bdd423e1f97d06e64590d42d0b68fb15bd766720d0be1dcbb01bc0d02f0c08
Contents?: true
Size: 675 Bytes
Versions: 7
Compression:
Stored size: 675 Bytes
Contents
# encoding: utf-8 require 'spec_helper' module Rubocop module Cop module Style describe IfWithSemicolon do let(:iws) { IfWithSemicolon.new } it 'registers an offence for one line if/;/end' do inspect_source(iws, ['if cond; run else dont end']) expect(iws.offences.map(&:message)).to eq( ['Never use if x; Use the ternary operator instead.']) end it 'can handle modifier conditionals' do inspect_source(iws, ['class Hash', 'end if RUBY_VERSION < "1.8.7"']) expect(iws.offences.map(&:message)).to be_empty end end end end end
Version data entries
7 entries across 7 versions & 2 rubygems