Sha256: cdedc7966e8651d53b6f3fedc16606125024c517bf2b57f048612d38a7b31490

Contents?: true

Size: 443 Bytes

Versions: 7

Compression:

Stored size: 443 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

module Rubocop
  module Cop
    module Style
      describe AvoidPerlBackrefs do
        let(:ap) { AvoidPerlBackrefs.new }

        it 'registers an offence for $1' do
          inspect_source(ap, ['puts $1'])
          expect(ap.offences.size).to eq(1)
          expect(ap.offences.map(&:message))
            .to eq(['Prefer the use of MatchData over $1.'])
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
rubocop-0.12.0 spec/rubocop/cop/style/avoid_perl_backrefs_spec.rb
rubocop-0.11.1 spec/rubocop/cop/style/avoid_perl_backrefs_spec.rb
rubocop-0.11.0 spec/rubocop/cops/style/avoid_perl_backrefs_spec.rb
rubocop-0.10.0 spec/rubocop/cops/style/avoid_perl_backrefs_spec.rb
rubocop-0.9.1 spec/rubocop/cops/style/avoid_perl_backrefs_spec.rb
sabat-rubocop-0.9.0 spec/rubocop/cops/style/avoid_perl_backrefs_spec.rb
rubocop-0.9.0 spec/rubocop/cops/style/avoid_perl_backrefs_spec.rb