Sha256: 3741f438ecb0b0f829c2362584c224c818d076d608264e5c2ff6e2d0e5254e2a

Contents?: true

Size: 414 Bytes

Versions: 2

Compression:

Stored size: 414 Bytes

Contents

# encoding: utf-8

module RuboCop
  module Cop
    module Test
      class ModuleMustBeAClassCop < RuboCop::Cop::Cop
        def on_module(node)
          add_offense(node, :expression, 'Module must be a Class')
        end

        def autocorrect(node)
          @corrections << lambda do |corrector|
            corrector.replace(node.loc.keyword, 'class')
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubocop-0.29.1 spec/support/cops/module_must_be_a_class_cop.rb
rubocop-0.29.0 spec/support/cops/module_must_be_a_class_cop.rb