Skip to content

Commit

Permalink
Merge pull request #571 from pharo-spec/adapt-to-classfactory-changes
Browse files Browse the repository at this point in the history
Use new API of ClassFactoryForTestCase
  • Loading branch information
MarcusDenker authored Sep 6, 2023
2 parents c1c65e8 + bef644f commit 5bcfdca
Showing 1 changed file with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,26 @@ StPlaygroundPagePresenterTest >> tearDown [

{ #category : #tests }
StPlaygroundPagePresenterTest >> testAddMenuCommandsTo [

| group commands class |
class := self classFactory make: [ :aBuilder | aBuilder superclass: StPlaygroundMenuExtensionCommand ].

class := self classFactory newSubclassOf: StPlaygroundMenuExtensionCommand.

group := CmCommandGroup forSpec.
presenter addMenuCommandsTo: group.
commands := group allCommands collect: [ :each | each innerCommand class ] as: Array.
self assert: (commands includes: class).

commands := group allCommands collect: [ :each | each innerCommand class ] as: Array.
self assert: (commands includes: class)
]

{ #category : #tests }
StPlaygroundPagePresenterTest >> testAddToolbarCommandsTo [

| group commands class |
class := self classFactory make: [ :aBuilder | aBuilder superclass: StPlaygroundToolbarExtensionCommand ].

class := self classFactory newSubclassOf: StPlaygroundToolbarExtensionCommand.

group := CmCommandGroup forSpec.
presenter addToolbarCommandsTo: group.
commands := group allCommands collect: [ :each | each innerCommand class ] as: Array.
self assert: (commands includes: class).

commands := group allCommands collect: [ :each | each innerCommand class ] as: Array.
self assert: (commands includes: class)
]

{ #category : #'tests - commands' }
Expand Down Expand Up @@ -148,12 +146,11 @@ StPlaygroundPagePresenterTest >> testPageIsSavedWhenExecutingACommand [

{ #category : #tests }
StPlaygroundPagePresenterTest >> testToolbarActions [

| group commands class |
class := self classFactory make: [ :aBuilder | aBuilder superclass: StPlaygroundToolbarExtensionCommand ].

class := self classFactory newSubclassOf: StPlaygroundToolbarExtensionCommand.

group := presenter toolbarActions.
commands := group allCommands collect: [ :each | each innerCommand class ] as: Array.
self assert: (commands includes: class).

commands := group allCommands collect: [ :each | each innerCommand class ] as: Array.
self assert: (commands includes: class)
]

0 comments on commit 5bcfdca

Please sign in to comment.