Sha256: bad5fd0112d27701d7d6dd435404b049ca8d53f3937fdcb5332b0c015fb72cad

Contents?: true

Size: 584 Bytes

Versions: 4

Compression:

Stored size: 584 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

module Rubocop
  module Cop
    describe LineContinuation do
      let(:lc) { LineContinuation.new }

      it 'registers an offence for line continuation char' do
        inspect_source(lc,
                       ['test = 5 \\', '+ 5'])
        expect(lc.offences.size).to eq(1)
      end

      it 'does not register an offence for cont char in a string' do
        inspect_source(lc,
                       ['result = "test string\\\n"',
                        'more'])
        expect(lc.offences).to be_empty
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubocop-0.8.3 spec/rubocop/cops/line_continuation_spec.rb
rubocop-0.8.2 spec/rubocop/cops/line_continuation_spec.rb
rubocop-0.8.1 spec/rubocop/cops/line_continuation_spec.rb
rubocop-0.8.0 spec/rubocop/cops/line_continuation_spec.rb