Skip to content

Commit

Permalink
Provide a proper category rule for "tests" in SUnit test methods
Browse files Browse the repository at this point in the history
Fix #9483
  • Loading branch information
astares committed Jun 17, 2021
1 parent b66d372 commit 5fcd143
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Renraku/ReProperMethodProtocolNameForTestsRule.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"
Rule to favour 'tests' method protocol for SUnit tests over 'test' as typically several test methods can/will be in the category
"
Class {
#name : #ReProperMethodProtocolNameForTestsRule,
#superclass : #ReProperMethodProtocolNameRule,
#category : #'Renraku-Rules'
}

{ #category : #running }
ReProperMethodProtocolNameForTestsRule >> basicCheck: aMethod [
"We only check for SUnit test methods"

^ aMethod isTestMethod and: [ self badMethodProtocolNames includes: aMethod category ]
]

{ #category : #idioms }
ReProperMethodProtocolNameForTestsRule >> protocolIdiom [

^self use: 'tests' insteadOf: #('test')
]

0 comments on commit 5fcd143

Please sign in to comment.