Sha256: dd7a4fe8966ef50d237a0fded11459a3a6fa9b287aab2dd68381bb470d07a8c2
Contents?: true
Size: 981 Bytes
Versions: 7
Compression:
Stored size: 981 Bytes
Contents
# encoding: utf-8 require 'spec_helper' module Rubocop module Cop module Style describe FavorJoin do let(:fj) { FavorJoin.new } it 'registers an offence for an array followed by string' do inspect_source(fj, ['%w(one two three) * ", "']) expect(fj.offences.size).to eq(1) expect(fj.offences.map(&:message)) .to eq([FavorJoin::MSG]) end it 'does not register an offence for numbers' do inspect_source(fj, ['%w(one two three) * 4']) expect(fj.offences).to be_empty end it 'does not register an offence for ambiguous cases' do inspect_source(fj, ['test * ", "']) expect(fj.offences).to be_empty inspect_source(fj, ['%w(one two three) * test']) expect(fj.offences).to be_empty end end end end end
Version data entries
7 entries across 7 versions & 2 rubygems