pharo icon indicating copy to clipboard operation
pharo copied to clipboard

Improve test of RBSplitClassMethod

Open Ducasse opened this issue 3 years ago • 1 comments

This test checks that when spliitting a class, accesses to several of the moved instance variables are correctly handled.

RBSplitClassParametrizedTest >> testSplitClassHandleMethodAccessingTwoMovedInstanceVariables
	|ref aModel|
	ref := self createRefactoringWithArguments:  
		{ #RBBasicLintRuleTestData . #(#methodBlock #classBlock) . #BlockClass . #blocks }.
	aModel := ref model.
	self executeRefactoring: ref.
			
	self assert: ((aModel classNamed: #RBBasicLintRuleTestData) parseTreeFor: #checkClassAccessingTheTwoInstanceVariables:) 
				equals: (self parseMethod: 'checkClassAccessingTheTwoInstanceVariables: aSmalllintContext 
	^blocks classBlock + blocks methodBlock value: aSmalllintContext value: result').

and we added

RBBasicLintRuleTestData >> checkClassAccessingTheTwoInstanceVariables: aSmalllintContext 
	^classBlock + methodBlock value: aSmalllintContext value: result

Ducasse avatar Apr 06 '22 15:04 Ducasse

after adding that method to the test data classs,

RBSearchTest>>testAllSearches RBVariableTypeTest>>testBasicLintRuleTypes

are failing.

MarcusDenker avatar Jun 17 '22 12:06 MarcusDenker