Class: RuboCop::Cop::Betterment::SpecHelperRequiredOutsideSpecDir
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::Betterment::SpecHelperRequiredOutsideSpecDir
- Defined in:
- lib/rubocop/cop/betterment/spec_helper_required_outside_spec_dir.rb
Overview
If a file requires spec_helper or rails_helper, make sure it is located in a spec/ directory.
Constant Summary collapse
- MSG =
'Spec helper required outside of a spec/ directory.'
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
25 26 27 |
# File 'lib/rubocop/cop/betterment/spec_helper_required_outside_spec_dir.rb', line 25 def on_send(node) add_offense(node) if requires_spec_helper?(node) && !spec_directory? end |