Class: RuboCop::Cop::RSpec::ExampleWording
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::RSpec::ExampleWording
- Defined in:
- lib/rubocop/cop/rspec/example_wording.rb
Overview
Do not use should when describing your tests. see: betterspecs.org/#should
Constant Summary collapse
- MSG =
'Do not use should when describing your tests.'
Instance Method Summary collapse
Instance Method Details
#on_block(node) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rubocop/cop/rspec/example_wording.rb', line 20 def on_block(node) method, _, _ = *node _, method_name, *args = *method return unless method_name == :it arguments = *(args.first) = arguments.first.to_s return unless .start_with?('should') add_offense(method, :selector, MSG) end |