Sha256: a55c56424664dd2a6ffd37eca033725eb2c1c2d7a45dab1ad6d577b78846a6a6

Contents?: true

Size: 545 Bytes

Versions: 6

Compression:

Stored size: 545 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Rubocop::Cop::Style::SpaceAfterNot do
  subject(:cop) { described_class.new }

  it 'reports an offense for space after !' do
    inspect_source(cop, ['! something'])
    expect(cop.offenses.size).to eq(1)
  end

  it 'accepts no space after !' do
    inspect_source(cop, ['!something'])
    expect(cop.offenses).to be_empty
  end

  it 'auto-corrects by removing redundant space' do
    new_source = autocorrect_source(cop, '!  something')
    expect(new_source).to eq('!something')
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubocop-0.22.0 spec/rubocop/cop/style/space_after_not_spec.rb
rubocop-0.21.0 spec/rubocop/cop/style/space_after_not_spec.rb
rubocop-0.20.1 spec/rubocop/cop/style/space_after_not_spec.rb
rubocop-0.20.0 spec/rubocop/cop/style/space_after_not_spec.rb
rubocop-0.19.1 spec/rubocop/cop/style/space_after_not_spec.rb
rubocop-0.19.0 spec/rubocop/cop/style/space_after_not_spec.rb