-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test that class creation does not create packages
- Loading branch information
Showing
5 changed files
with
42 additions
and
10 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...re-Tests.package/FLTCreateClassOrTraitSerializationTest.trait/instance/fullySerialize..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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
helpers | ||
fullySerialize: aClass | ||
self serializer fullySerializeBehavior: aClass. | ||
self serialize: aClass |
8 changes: 8 additions & 0 deletions
8
...sts.package/FLTCreateClassOrTraitSerializationTest.trait/instance/materializeSilently..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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
helpers | ||
materializeSilently: aBoolean | ||
|
||
| materialized | | ||
materialized := self materialized. | ||
self classFactory registerBehavior: materialized. | ||
aBoolean ifTrue: [ self classFactory createdSilently add: materialized ]. | ||
^ materialized |
13 changes: 4 additions & 9 deletions
13
...ateClassOrTraitSerializationTest.trait/instance/resultOfSerializeRemoveAndMaterialize..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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
tests | ||
helpers | ||
resultOfSerializeRemoveAndMaterialize: aClass | ||
|
||
| materialized wasSilent | | ||
self serializer fullySerializeBehavior: aClass. | ||
self serialize: aClass. | ||
| wasSilent | | ||
self fullySerialize: aClass. | ||
wasSilent := self classFactory createdSilently includes: aClass. | ||
self classFactory delete: aClass. | ||
materialized := self materialized. | ||
self classFactory registerBehavior: materialized. | ||
wasSilent ifTrue: [ self classFactory createdSilently add: materialized ]. | ||
^ materialized | ||
^ self materializeSilently: wasSilent |
2 changes: 1 addition & 1 deletion
2
...ClassOrTraitSerializationTest.trait/instance/resultOfSerializeRemoveAndMaterializeAll..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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
tests | ||
helpers | ||
resultOfSerializeRemoveAndMaterializeAll: objects | ||
|
||
| classesOrTraits materialized silent | | ||
|
25 changes: 25 additions & 0 deletions
25
...package/FLTCreateClassOrTraitSerializationTest.trait/instance/testDoesNotCreatePackage.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
tests | ||
testDoesNotCreatePackage | ||
"Tests materialization of a package not defined in the image." | ||
|
||
| undefinedPackage aClassOrTrait materializedClassOrTrait package packageTag wasSilent | | ||
undefinedPackage := self packageOrganizer undefinedPackage. | ||
aClassOrTrait := self newClassOrTrait. | ||
package := aClassOrTrait package. | ||
packageTag := aClassOrTrait packageTag. | ||
|
||
self deny: package identicalTo: undefinedPackage. | ||
|
||
self fullySerialize: aClassOrTrait. | ||
wasSilent := self classFactory createdSilently includes: aClassOrTrait. | ||
self classFactory delete: aClassOrTrait. | ||
|
||
package removeFromSystem. | ||
self deny: (self packageOrganizer hasPackage: package). | ||
|
||
materializedClassOrTrait := self materializeSilently: wasSilent. | ||
|
||
self deny: package identicalTo: materializedClassOrTrait package. | ||
self assert: materializedClassOrTrait package identicalTo: undefinedPackage. | ||
self deny: packageTag name equals: materializedClassOrTrait packageTag name. | ||
self assert: materializedClassOrTrait packageTag identicalTo: undefinedPackage undefinedTag |