Class: RuboCop::Cop::RSpec::DescribeClass
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::RSpec::DescribeClass
- Includes:
- RSpec::TopLevelDescribe
- Defined in:
- lib/rubocop/cop/rspec/describe_class.rb
Overview
Check that the first argument to the top level describe is the tested class or module.
Constant Summary collapse
- MESSAGE =
'The first argument to describe should be the class or ' \ 'module being tested.'
Instance Method Summary collapse
Methods included from RSpec::TopLevelDescribe
Instance Method Details
#on_top_level_describe(_node, args) ⇒ Object
23 24 25 26 |
# File 'lib/rubocop/cop/rspec/describe_class.rb', line 23 def on_top_level_describe(_node, args) return if args.first && args.first.type == :const add_offense(args.first, :expression, MESSAGE) end |