Sha256: 232ac342fa4e8981c7e46644bc2ffb971c5d532f35ae08a1ed77b7ba07726e15

Contents?: true

Size: 561 Bytes

Versions: 1

Compression:

Stored size: 561 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

        it 'registers an offence for missing final newline' do
          source = ['x = 0', 'top']
          inspect_source(cop, source)
          expect(cop.offences.size).to eq(1)
        end

        it 'accepts a final newline' do
          source = ['x = 0', 'top', '']
          inspect_source(cop, source)
          expect(cop.offences).to be_empty
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubocop-0.13.0 spec/rubocop/cop/style/final_newline_spec.rb