From 33f5aab110c7753e82290c7e5f293186eb51ba60 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 30 Jan 2024 15:37:36 +0100 Subject: [PATCH] Remove some deprecated calls in P12 #when:do: got deprecated in P12 --- src/Moose-Core-Tests/MooseModelTest.class.st | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Moose-Core-Tests/MooseModelTest.class.st b/src/Moose-Core-Tests/MooseModelTest.class.st index 6bed401b..de60edd8 100644 --- a/src/Moose-Core-Tests/MooseModelTest.class.st +++ b/src/Moose-Core-Tests/MooseModelTest.class.st @@ -20,9 +20,10 @@ MooseModelTest >> testAdd [ { #category : #tests } MooseModelTest >> testAddAnnouncement [ + | entity announcedEntity | entity := MooseEntity new. - group announcer when: MooseEntityAdded do: [ :a | announcedEntity := a entity ]. + group announcer when: MooseEntityAdded do: [ :a | announcedEntity := a entity ] for: self. group add: entity. self assert: announcedEntity identicalTo: entity @@ -57,10 +58,11 @@ MooseModelTest >> testAsMSEString [ { #category : #tests } MooseModelTest >> testBookmarkAsRaisesAnnouncement [ + | entity1 announcedEntity | entity1 := MooseEntity new. group add: entity1. - group announcer when: MooseEntityAdded do: [ :a | announcedEntity := a entity ]. + group announcer when: MooseEntityAdded do: [ :a | announcedEntity := a entity ] for: self. entity1 bookmarkAs: 'one'. self assert: announcedEntity isNotNil @@ -162,9 +164,10 @@ MooseModelTest >> testRemoveAllEntity [ { #category : #tests } MooseModelTest >> testRemoveAnnouncement [ + | entity announcedEntity | entity := MooseEntity new. - group announcer when: MooseEntityRemoved do: [ :a | announcedEntity := a entity ]. + group announcer when: MooseEntityRemoved do: [ :a | announcedEntity := a entity ] for: self. group add: entity. self assert: announcedEntity isNil. group remove: entity. @@ -213,8 +216,9 @@ MooseModelTest >> testRemoveModelNamedFromRoot [ { #category : #tests } MooseModelTest >> testRenamedAnnouncement [ + | oldName | - group announcer when: MooseEntityRenamed do: [ :a | oldName := a oldName ]. + group announcer when: MooseEntityRenamed do: [ :a | oldName := a oldName ] for: self. group name: #somename. self assert: oldName equals: #noname. group name: #anothername.