Sha256: aa1a7dc647f86420514664ac06befa115a9f0ba60b8d9462f306a9ade122a610
Contents?: true
Size: 841 Bytes
Versions: 8
Compression:
Stored size: 841 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module RSpec # Avoid opening modules and defining specs within them. # # @example # # bad # module MyModule # RSpec.describe MyClass do # # ... # end # end # # # good # RSpec.describe MyModule::MyClass do # # ... # end # # @see https://github.com/rubocop-hq/rubocop-rspec/issues/735 class DescribedClassModuleWrapping < Cop MSG = 'Avoid opening modules and defining specs within them.' def_node_search :find_rspec_blocks, ExampleGroups::ALL.block_pattern def on_module(node) find_rspec_blocks(node) do add_offense(node) end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems