Skip to content

Commit

Permalink
Allow test_ method names to violate snake_case
Browse files Browse the repository at this point in the history
Tests are a use case where it is sometimes valuable to be able to
violate the `snake_case` convention. For example

    def test_GET_request_response_is_200_OK
  • Loading branch information
sambostock committed Mar 8, 2023
1 parent d32949d commit 1369448
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ Naming/InclusiveLanguage:
Naming/MemoizedInstanceVariableName:
Enabled: false

Naming/MethodName:
AllowedPatterns:
- '\Atest_'

Naming/MethodParameterName:
Enabled: false

Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/full_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2134,7 +2134,8 @@ Naming/MethodName:
SupportedStyles:
- snake_case
- camelCase
AllowedPatterns: []
AllowedPatterns:
- "\\Atest_"
Naming/MethodParameterName:
Description: Checks for method parameter names that contain capital letters, end
in numbers, or do not meet a minimal length.
Expand Down

0 comments on commit 1369448

Please sign in to comment.