Sha256: cc5251baf99455df2aa0317eb741527d5072b750b3c1905ff9b92a2c2e0e1452
Contents?: true
Size: 959 Bytes
Versions: 10
Compression:
Stored size: 959 Bytes
Contents
# encoding: utf-8 require 'spec_helper' module Rubocop module Cop describe Syntax do let(:sc) { Syntax.new } it 'registers an offence for unused variables', ruby: 2.0 do sc.inspect('file.rb', ['x = 5', 'puts 10'], nil, nil) expect(sc.offences.size).to eq(1) expect(sc.offences.first.message) .to eq('Assigned but unused variable - x') end describe '#process_line' do it 'processes warnings correctly' do l, s, m = sc.process_line('admin.rb:1: warning: possibly useless') expect(l).to eq(1) expect(s).to eq(:warning) expect(m).to eq('Possibly useless') end it 'processes errors correctly' do l, s, m = sc.process_line('admin.rb:1: unterminated string meets') expect(l).to eq(1) expect(s).to eq(:error) expect(m).to eq('Unterminated string meets') end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems