Sha256: b94a4f1a626d7127c8f03ed3298f818d8cd7be2b0bbd72ffc41999365cd04796

Contents?: true

Size: 601 Bytes

Versions: 5

Compression:

Stored size: 601 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

  it "registers an offense for a line that's 80 characters wide" do
    inspect_source(cop, ['#' * 80])
    expect(cop.offenses.size).to eq(1)
    expect(cop.offenses.first.message).to eq('Line is too long. [80/79]')
    expect(cop.config_to_allow_offenses).to eq('Max' => 80)
  end

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubocop-0.21.0 spec/rubocop/cop/style/line_length_spec.rb
rubocop-0.20.1 spec/rubocop/cop/style/line_length_spec.rb
rubocop-0.20.0 spec/rubocop/cop/style/line_length_spec.rb
rubocop-0.19.1 spec/rubocop/cop/style/line_length_spec.rb
rubocop-0.19.0 spec/rubocop/cop/style/line_length_spec.rb