Class: RuboCop::Cop::RSpec::MissingExampleGroupArgument
- Defined in:
- lib/rubocop/cop/rspec/missing_example_group_argument.rb
Overview
Checks that the first argument to an example group is not empty.
Constant Summary collapse
- MSG =
'The first argument to `%<method>s` should not be empty.'
Constants inherited from Cop
Cop::DEFAULT_CONFIGURATION, Cop::DEFAULT_PATTERN_RE
Constants included from RSpec::Language
RSpec::Language::ALL, RSpec::Language::RSPEC
Instance Method Summary collapse
Methods inherited from Cop
Instance Method Details
#on_block(node) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/rubocop/cop/rspec/missing_example_group_argument.rb', line 25 def on_block(node) return unless example_group?(node) return if node.send_node.arguments? add_offense(node, location: :expression, message: format(MSG, method: node.method_name)) end |