Skip to content

Commit

Permalink
Use new API of ClassFactoryForTestCase
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
jecisc committed Aug 1, 2023
1 parent 9f56efd commit ca0183b
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/Spec2-Backend-Tests/SpScrollableLayoutAdapterTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit ca0183b

Please sign in to comment.