-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Added compatibility package for P12. Moved P12 version dependent meth…
…ods to this package.
Showing
4 changed files
with
112 additions
and
3 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
103 changes: 103 additions & 0 deletions
103
dev/src/ExercismPharo120/ExercismSubmissionTest.extension.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,103 @@ | ||
Extension { #name : #ExercismSubmissionTest } | ||
|
||
{ #category : #'*ExercismPharo120' } | ||
ExercismSubmissionTest class >> mockSnapshotSTON [ | ||
^ 'MCSnapshot { | ||
#definitions : OrderedCollection [ | ||
MCOrganizationDefinition { | ||
#packageName : #''Exercise@DependencyMock'', | ||
#tagNames : [ ] | ||
}, | ||
MCMethodDefinition { | ||
#classIsMeta : false, | ||
#source : ''mockMethod ^ \''Call from class: \'', self class name'', | ||
#category : #''as yet unclassified'', | ||
#selector : #mockMethod, | ||
#className : #CMock | ||
}, | ||
MCMethodDefinition { | ||
#classIsMeta : false, | ||
#source : ''mockMethod ^ CMock mockMethod'', | ||
#category : #''as yet unclassified'', | ||
#selector : #mockMethod, | ||
#className : #BMock | ||
}, | ||
MCMethodDefinition { | ||
#classIsMeta : false, | ||
#source : ''mockMethod ^ BMock mockMethod'', | ||
#category : #''as yet unclassified'', | ||
#selector : #mockMethod, | ||
#className : #AMock | ||
}, | ||
MCClassDefinition { | ||
#name : #CMock, | ||
#superclassName : #Object, | ||
#variables : OrderedCollection [ ], | ||
#packageName : #''Exercise@DependencyMock'', | ||
#type : #normal, | ||
#comment : '''', | ||
#commentStamp : '''', | ||
#traitComposition : ''{}'', | ||
#classTraitComposition : ''{}'' | ||
}, | ||
MCClassDefinition { | ||
#name : #BMock, | ||
#superclassName : #CMock, | ||
#variables : OrderedCollection [ ], | ||
#packageName : #''Exercise@DependencyMock'', | ||
#type : #normal, | ||
#comment : '''', | ||
#commentStamp : '''', | ||
#traitComposition : ''{}'', | ||
#classTraitComposition : ''{}'' | ||
}, | ||
MCClassDefinition { | ||
#name : #AMock, | ||
#superclassName : #BMock, | ||
#variables : OrderedCollection [ ], | ||
#packageName : #''Exercise@DependencyMock'', | ||
#type : #normal, | ||
#comment : '''', | ||
#commentStamp : '''', | ||
#traitComposition : ''{}'', | ||
#classTraitComposition : ''{}'' | ||
} | ||
], | ||
#classDefinitionCache : { | ||
#AMock : @12, | ||
#CMock : @8, | ||
#BMock : @10 | ||
} | ||
}' | ||
] | ||
|
||
{ #category : #'*ExercismPharo120' } | ||
ExercismSubmissionTest class >> prepareMockPackageWithDependentClasses [ | ||
" this is used for generating STON representation of MCSnapshot (see class side method), we don't need to create classes during test" | ||
|aClass bClass cClass aPackage| | ||
|
||
cClass := Object << #CMock | ||
slots: {}; | ||
sharedVariables: {}; | ||
package: 'Exercise@DependencyMock'; | ||
install. | ||
|
||
bClass := (self class environment at: #CMock) << #BMock | ||
slots: {}; | ||
sharedVariables: {}; | ||
package: 'Exercise@DependencyMock'; | ||
install. | ||
|
||
aClass := (self class environment at: #BMock) << #AMock | ||
slots: {}; | ||
sharedVariables: {}; | ||
package: 'Exercise@DependencyMock'; | ||
install. | ||
|
||
aClass compile: 'mockMethod ^ BMock mockMethod'. | ||
bClass compile: 'mockMethod ^ CMock mockMethod'. | ||
cClass compile: 'mockMethod ^ ''Call from class: '', self class name'. | ||
|
||
aPackage := PackageOrganizer default packageNamed: 'Exercise@DependencyMock'. | ||
^ TonelWriter new toSTON: aPackage snapshot. | ||
] |
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 @@ | ||
Package { #name : #ExercismPharo120 } |
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