Sha256: 89ff9edea5b91e2b4b854aaf95f7eb86d9efbf29c240c4fc4050b0b7d88f6b2b

Contents?: true

Size: 650 Bytes

Versions: 2

Compression:

Stored size: 650 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

module Rubocop
  module Cop
    module Style
      describe LineLength, :config do
        subject(:ll) { LineLength.new(config) }
        let(:cop_config) { { 'Max' => 79 } }

        it "registers an offence for a line that's 80 characters wide" do
          inspect_source(ll, ['#' * 80])
          expect(ll.offences.size).to eq(1)
          expect(ll.offences.first.message).to eq('Line is too long. [80/79]')
        end

        it "accepts a line that's 79 characters wide" do
          inspect_source(ll, ['#' * 79])
          expect(ll.offences).to be_empty
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubocop-0.13.1 spec/rubocop/cop/style/line_length_spec.rb
rubocop-0.13.0 spec/rubocop/cop/style/line_length_spec.rb