Sha256: 3230a14fdaab8eae35b23129aa0ffa5c6b4b0f7f0d4b28d6884b09ab038b16cb

Contents?: true

Size: 904 Bytes

Versions: 7

Compression:

Stored size: 904 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

module Rubocop
  module Cop
    module Style
      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
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
rubocop-0.12.0 spec/rubocop/cop/style/space_after_comma_spec.rb
rubocop-0.11.1 spec/rubocop/cop/style/space_after_comma_spec.rb
rubocop-0.11.0 spec/rubocop/cops/style/space_after_comma_spec.rb
rubocop-0.10.0 spec/rubocop/cops/style/space_after_comma_spec.rb
rubocop-0.9.1 spec/rubocop/cops/style/space_after_comma_spec.rb
sabat-rubocop-0.9.0 spec/rubocop/cops/style/space_after_comma_spec.rb
rubocop-0.9.0 spec/rubocop/cops/style/space_after_comma_spec.rb