Sha256: 5b4238d2100ad12d3d5b031c641838d27713a4bfa1cbf8cc7aee5bd966328da3

Contents?: true

Size: 697 Bytes

Versions: 2

Compression:

Stored size: 697 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)
        expect(a.offences.map(&:message))
          .to eq([Not::MSG])
      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.1 spec/rubocop/cops/not_spec.rb
rubocop-0.8.0 spec/rubocop/cops/not_spec.rb