Sha256: 04a4688a41c31fa137a8c4caa8b818b781e398245c9940f5ba9e98dc8a3bdd5c

Contents?: true

Size: 580 Bytes

Versions: 13

Compression:

Stored size: 580 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

      it 'registers an offence for CR+LF' do
        inspect_source(eol, 'file.rb', ["x=0\r", ''])
        expect(eol.offences.map(&:message)).to eq(
          ['Carriage return character detected.'])
      end

      it 'registers an offence for CR at end of file' do
        inspect_source(eol, 'file.rb', ["x=0\r"])
        expect(eol.offences.map(&:message)).to eq(
          ['Carriage return character detected.'])
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rubocop-0.7.2 spec/rubocop/cops/end_of_line_spec.rb
rubocop-0.7.1 spec/rubocop/cops/end_of_line_spec.rb
rubocop-0.7.0 spec/rubocop/cops/end_of_line_spec.rb
rubocop-0.6.1 spec/rubocop/cops/end_of_line_spec.rb
rubocop-0.6.0 spec/rubocop/cops/end_of_line_spec.rb
rubocop-0.5.0 spec/rubocop/cops/end_of_line_spec.rb
rubocop-0.4.6 spec/rubocop/cops/end_of_line_spec.rb
rubocop-0.4.5 spec/rubocop/cops/end_of_line_spec.rb
rubocop-0.4.4 spec/rubocop/cops/end_of_line_spec.rb
rubocop-0.4.3 spec/rubocop/cops/end_of_line_spec.rb
rubocop-0.4.2 spec/rubocop/cops/end_of_line_spec.rb
rubocop-0.4.1 spec/rubocop/cops/end_of_line_spec.rb
rubocop-0.4.0 spec/rubocop/cops/end_of_line_spec.rb