Sha256: 2c5e4664de55b5b9700de2be9cf0c965fbdfb2d6ebc8df31ffe4a5f2e6118a78
Contents?: true
Size: 1.3 KB
Versions: 5
Compression:
Stored size: 1.3 KB
Contents
# encoding: utf-8 require 'spec_helper' module Rubocop module Cop describe PercentLiterals do let(:pl) { PercentLiterals.new } it 'registers an offence for %q' do inspect_source(pl, 'file.rb', ['puts %q(test)']) expect(pl.offences.size).to eq(1) expect(pl.offences.map(&:message)) .to eq(['The use of %q is discouraged.']) end it 'registers an offence for %Q' do inspect_source(pl, 'file.rb', ['puts %Q(test)']) expect(pl.offences.size).to eq(1) expect(pl.offences.map(&:message)) .to eq(['The use of %Q is discouraged.']) end it 'registers an offence for %x' do inspect_source(pl, 'file.rb', ['puts %x(test)']) expect(pl.offences.size).to eq(1) expect(pl.offences.map(&:message)) .to eq(['The use of %x is discouraged.']) end it 'registers an offence for %s' do inspect_source(pl, 'file.rb', ['puts %s(test)']) expect(pl.offences.size).to eq(1) expect(pl.offences.map(&:message)) .to eq(['The use of %s is discouraged.']) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems