diff --git a/src/MCP-Tests/MCPToolMethodMutationTest.class.st b/src/MCP-Tests/MCPToolMethodMutationTest.class.st index 3c3b911..424624a 100644 --- a/src/MCP-Tests/MCPToolMethodMutationTest.class.st +++ b/src/MCP-Tests/MCPToolMethodMutationTest.class.st @@ -826,6 +826,22 @@ MCPToolMethodMutationTest >> testCompileReturnsAllowlistedWarningCritiques [ self removeSelector: selector from: MCPToolGetMethodTestTarget ] ] +{ #category : 'tests' } +MCPToolMethodMutationTest >> testCompileReturnsAssignmentInBlockCritique [ + + | selector | + selector := #assignmentInBlockProbe. + self removeSelector: selector from: MCPToolMethodMutationTestTarget. + [ + self + assertCompileForClassName: 'MCPToolMethodMutationTestTarget' + methodSource: 'assignmentInBlockProbe | value | [ value := 1 ] ensure: [ ] . ^ value' + protocol: 'tests' + returnsSingleCritiqueRuleClass: 'ReAssignmentInBlockRule' + titledLike: 'Unnecessary assignment or return in block' ] ensure: [ + self removeSelector: selector from: MCPToolMethodMutationTestTarget ] +] + { #category : 'tests' } MCPToolMethodMutationTest >> testCompileReturnsCollectionThenDoCritique [ diff --git a/src/MCP/MCPToolMethodMutation.class.st b/src/MCP/MCPToolMethodMutation.class.st index a7c1729..a5feaf8 100644 --- a/src/MCP/MCPToolMethodMutation.class.st +++ b/src/MCP/MCPToolMethodMutation.class.st @@ -57,6 +57,7 @@ MCPToolMethodMutation >> allowedNonErrorCritiqueRuleClasses [ MCPRespondsToUsageRule. MCPSelectSizeCountRule. MCPSortedCollectionConversionRule. + ReAssignmentInBlockRule. ReEquivalentSuperclassMethodsRule. ReExcessiveArgumentsRule. ReMissingSuperSendsRule.