-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixing problem when sharing the same talent and different original class - Adding test
- Loading branch information
Showing
9 changed files
with
108 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/Talents-Tests/TaArrayTests.class.st → src/Talents-Tests/TaArrayTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
Class { | ||
#name : #TaSharingAnonymousClassesTest, | ||
#superclass : #TaAbstractTalentTest, | ||
#instVars : [ | ||
'objectA', | ||
'objectB', | ||
'aTalent', | ||
'aClass', | ||
'anotherClass', | ||
'objectC' | ||
], | ||
#category : #'Talents-Tests' | ||
} | ||
|
||
{ #category : #tests } | ||
TaSharingAnonymousClassesTest >> setUp [ | ||
|
||
super setUp. | ||
|
||
aTalent := self newTalent: #ATalent with: #(). | ||
aClass := self newClass: #ATClass1 with: #(). | ||
anotherClass := self newClass: #ATClass2 with: #(). | ||
|
||
objectA := aClass new . | ||
objectB := anotherClass new . | ||
objectC := aClass new . | ||
|
||
objectA addTalent: aTalent. | ||
objectB addTalent: aTalent. | ||
objectC addTalent: aTalent. | ||
|
||
] | ||
|
||
{ #category : #tests } | ||
TaSharingAnonymousClassesTest >> testHavingTwoObjectsWithTheSameTalentAndDifferentInitialClassDoNotSharesAnonymousClass [ | ||
|
||
self deny: objectA class == objectB class | ||
|
||
|
||
|
||
] | ||
|
||
{ #category : #tests } | ||
TaSharingAnonymousClassesTest >> testHavingTwoObjectsWithTheSameTalentAndInitialClassSharesAnonymousClass [ | ||
|
||
self assert: objectA class == objectC class | ||
|
||
|
||
|
||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Extension { #name : #TaAbstractComposition } | ||
|
||
{ #category : #'*Talents' } | ||
TaAbstractComposition >> >> anAssociation [ | ||
|
||
^ self @@ { anAssociation } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters