Sha256: ab54828551175a7b744d0448c8618af69d1820ac7d815af0e1863c9c1826836c

Contents?: true

Size: 403 Bytes

Versions: 3

Compression:

Stored size: 403 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

module Rubocop
  module Cop
    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'])
        iws.offences.map(&:message).should ==
          ['Never use if x; Use the ternary operator instead.']
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubocop-0.3.2 spec/rubocop/cops/if_with_semicolon_spec.rb
rubocop-0.3.1 spec/rubocop/cops/if_with_semicolon_spec.rb
rubocop-0.3.0 spec/rubocop/cops/if_with_semicolon_spec.rb