Class: Gitlab::Styles::Rubocop::Cop::RSpec::ExampleStartingCharacter
- Inherits:
-
Base
- Object
- RuboCop::Cop::RSpec::Base
- Base
- Gitlab::Styles::Rubocop::Cop::RSpec::ExampleStartingCharacter
- Extended by:
- RuboCop::Cop::AutoCorrector
- Defined in:
- lib/gitlab/styles/rubocop/cop/rspec/example_starting_character.rb
Overview
Checks for common mistakes in example descriptions.
This cop will correct docstrings that begin/end with space or words that start with a capital letter.
Constant Summary collapse
- MSG =
'Only start words with lowercase alpha with no leading/trailing spaces when describing your tests.'
Constants included from Rspec::Helpers
Rspec::Helpers::LET, Rspec::Helpers::LET_IT_BE_HELPERS
Instance Method Summary collapse
Instance Method Details
#on_block(node) ⇒ Object
64 65 66 67 68 |
# File 'lib/gitlab/styles/rubocop/cop/rspec/example_starting_character.rb', line 64 def on_block(node) it_description(node) do |description_node, | add_wording_offense(description_node, MSG) if invalid_description?(text(description_node)) end end |