File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed
Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ Class {
2+ #name : #ExercismHintRule ,
3+ #superclass : #ReAbstractRule ,
4+ #category : #ExercismTools
5+ }
6+
7+ { #category : #accessing }
8+ ExercismHintRule >> group [
9+ ^ ' Exercism Hint'
10+ ]
11+
12+ { #category : #accessing }
13+ ExercismHintRule >> severity [
14+ ^ #warning
15+
16+ ]
Original file line number Diff line number Diff line change 1+ "
2+ The TwoFer exercise introduces you to calling between methods.
3+ For practice, your '#who' method should reuse your '#who:' method.
4+ "
5+ Class {
6+ #name : #ExercismHintTwoFerReuseRule ,
7+ #superclass : #ExercismHintRule ,
8+ #category : #ExercismTools
9+ }
10+
11+ { #category : #' testing-interest' }
12+ ExercismHintTwoFerReuseRule class >> checksMethod [
13+ ^ true
14+ ]
15+
16+ { #category : #accessing }
17+ ExercismHintTwoFerReuseRule >> basicCheck: compiledMethod [
18+ compiledMethod methodClass name = #TwoFer ifTrue: [
19+ |literals |
20+ literals := compiledMethod sourceCode parseLiterals.
21+ literals first = #who ifTrue: [ ^ (literals includes: #who: ) not ].
22+ ].
23+ ^ false
24+
25+ ]
26+
27+ { #category : #accessing }
28+ ExercismHintTwoFerReuseRule >> name [
29+ ^ ' Exercism: Method #who should reuse method #who: '
30+ ]
You can’t perform that action at this time.
0 commit comments