Sha256: f57afdd9c1d504b3735e1ce4d1d6a678d6153710272d64a593a15058dcad498e

Contents?: true

Size: 575 Bytes

Versions: 2

Compression:

Stored size: 575 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

  it 'registers an offence for a line ending with space' do
    source = ['x = 0 ']
    inspect_source(cop, source)
    expect(cop.offences.size).to eq(1)
  end

  it 'registers an offence for a line ending with tab' do
    inspect_source(cop, ["x = 0\t"])
    expect(cop.offences.size).to eq(1)
  end

  it 'accepts a line without trailing whitespace' do
    inspect_source(cop, ["x = 0\n"])
    expect(cop.offences).to be_empty
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubocop-0.14.1 spec/rubocop/cop/style/trailing_whitespace_spec.rb
rubocop-0.14.0 spec/rubocop/cop/style/trailing_whitespace_spec.rb