Sha256: c96de07b9729aad7cd7422a1675f2e50486899fd4928c9ef6739b89e88a06e87

Contents?: true

Size: 782 Bytes

Versions: 3

Compression:

Stored size: 782 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

module Rubocop
  module Cop
    describe Semicolon do
      let(:s) { Semicolon.new }

      it 'registers an offence for a single expression' do
        inspect_source(s,
                       'file.rb',
                       ['puts "this is a test";'])
        expect(s.offences.size).to eq(1)
        expect(s.offences.map(&:message))
          .to eq([Semicolon::ERROR_MESSAGE])
      end

      it 'registers an offence for several expressions' do
        inspect_source(s,
                       'file.rb',
                       ['puts "this is a test"; puts "So is this"'])
        expect(s.offences.size).to eq(1)
        expect(s.offences.map(&:message))
          .to eq([Semicolon::ERROR_MESSAGE])
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubocop-0.6.1 spec/rubocop/cops/semicolon_spec.rb
rubocop-0.6.0 spec/rubocop/cops/semicolon_spec.rb
rubocop-0.5.0 spec/rubocop/cops/semicolon_spec.rb