Sha256: 38fb0e5082bad17e96a1f14124de94ec91da5f162dbc1f9532878523b07bab41

Contents?: true

Size: 557 Bytes

Versions: 2

Compression:

Stored size: 557 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

module Rubocop
  module Cop
    describe Not do
      let(:a) { Not.new }

      it 'registers an offence for not' do
        inspect_source(a, ['not test'])
        expect(a.offences.size).to eq(1)
      end

      it 'does not register an offence for !' do
        inspect_source(a, ['!test'])
        expect(a.offences).to be_empty
      end

      it 'does not register an offence for :not' do
        inspect_source(a, ['[:not, :if, :else]'])
        expect(a.offences).to be_empty
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubocop-0.8.3 spec/rubocop/cops/not_spec.rb
rubocop-0.8.2 spec/rubocop/cops/not_spec.rb