From ca0183b95a1a117e8086bb861fe726a0767f8201 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 1 Aug 2023 12:01:20 +0200 Subject: [PATCH] Use new API of ClassFactoryForTestCase ClassFactoryForTestCase duplicates a lot of the old class creation API that is not extensioble and huge. A new way of creating classes through it is been implemented. Here is a PR with changes about this. Note that this PR is not inegrable yet since it depends on this PR: pharo-project/pharo#14398 (I just do not want to lose my changes) --- .../SpScrollableLayoutAdapterTest.class.st | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/Spec2-Backend-Tests/SpScrollableLayoutAdapterTest.class.st b/src/Spec2-Backend-Tests/SpScrollableLayoutAdapterTest.class.st index b1c089fe0..cbbe412d9 100644 --- a/src/Spec2-Backend-Tests/SpScrollableLayoutAdapterTest.class.st +++ b/src/Spec2-Backend-Tests/SpScrollableLayoutAdapterTest.class.st @@ -48,24 +48,22 @@ SpScrollableLayoutAdapterTest >> testAddTwiceSetsChildrenSingleTime [ { #category : #tests } SpScrollableLayoutAdapterTest >> testAddWithSymbolWorks [ + | presenterClass | - classFactory := self newClassFactory. - presenterClass := classFactory - newSubclassOf: SpPresenter - instanceVariableNames: 'textInput' - classVariableNames: '' - category: self class package name. - + presenterClass := classFactory make: [ :aBuilder | + aBuilder + superclass: SpPresenter; + slotsFromString: 'textInput'; + package: self class package name ]. + presenter := presenterClass new. presenter layout: (SpScrollableLayout with: #textInput). presenter writeSlotNamed: #textInput value: presenter newTextInput. - + self openInstance. - - self - assert: presenter adapter childWidget - equals: (presenter readSlotNamed: #textInput) adapter widget + + self assert: presenter adapter childWidget equals: (presenter readSlotNamed: #textInput) adapter widget ] { #category : #tests }