Sha256: 7b2bd20dba60abc05a8fca6af8fc577a2f716fb225709395f205d3602c6e7f9a

Contents?: true

Size: 843 Bytes

Versions: 4

Compression:

Stored size: 843 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

module Rubocop
  module Cop
    describe SpaceAfterComma do
      let(:space) { SpaceAfterComma.new }

      it 'registers an offence for block argument commas without space' do
        inspect_source(space, ['each { |s,t| }'])
        expect(space.offences.map(&:message)).to eq(
          ['Space missing after comma.'])
      end

      it 'registers an offence for array index commas without space' do
        inspect_source(space, ['formats[0,1]'])
        expect(space.offences.map(&:message)).to eq(
          ['Space missing after comma.'])
      end

      it 'registers an offence for method call arg commas without space' do
        inspect_source(space, ['a(1,2)'])
        expect(space.offences.map(&:message)).to eq(
          ['Space missing after comma.'])
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubocop-0.8.3 spec/rubocop/cops/space_after_comma_spec.rb
rubocop-0.8.2 spec/rubocop/cops/space_after_comma_spec.rb
rubocop-0.8.1 spec/rubocop/cops/space_after_comma_spec.rb
rubocop-0.8.0 spec/rubocop/cops/space_after_comma_spec.rb