Sha256: 19832a99e07bdd4ca4b3bae1beb7cd4ddaa2e71e63cdd86ff29e0b270853480a

Contents?: true

Size: 609 Bytes

Versions: 3

Compression:

Stored size: 609 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

      it 'initially has 0 offences' do
        cop.offences.size.should == 0
      end

      it 'initially has nothing to report' do
        cop.has_report?.should be_false
      end

      it 'keeps track of offences' do
        cop.add_offence(:convention, 1, 'message')

        cop.offences.size.should == 1
      end

      it 'will report registered offences' do
        cop.add_offence(:convention, 1, 'message')

        cop.has_report?.should be_true
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubocop-0.3.2 spec/rubocop/cops/cop_spec.rb
rubocop-0.3.1 spec/rubocop/cops/cop_spec.rb
rubocop-0.3.0 spec/rubocop/cops/cop_spec.rb