Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

610 all pharo tests pass even though i didnt solve the exercise #611

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions dev/src/BaselineOfExercism/BaselineOfExercism.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ BaselineOfExercism >> baseline: spec [
group: 'testRunnerTests' with: #('ExercismTestRunnerTests'), self class exerciseGoldenTestPackageNames;
group: 'v3' with: #('ExercismV3')
].
spec for: #'pharo11.x' do: [
"ExercismTools methods will add methods from compatibility package for Pharo 11"
spec package: 'ExercismTests' with: [ spec includes: #('ExercismPharo110') ].
spec package: 'ExercismPharo110'
].
spec for: #'pharo12.x' do: [
"ExercismTools methods will be overwritten by compatibility package for Pharo 12"
spec package: 'ExercismTests' with: [ spec includes: #('ExercismPharo120') ].
Expand Down
24 changes: 24 additions & 0 deletions dev/src/ExercismPharo110/Class.extension.st
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per discussion on Pharo Discord. Solution recommended by one of founders: https://discord.com/channels/223421264751099906/278558427796602882/1209857931022049280

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Extension { #name : #Class }

{ #category : #'*ExercismPharo110' }
Class >> removeFromSystem: logged [
"Forget the receiver from the Smalltalk global dictionary. Any existing instances will refer to an obsolete version of the receiver.
Keep the class name and category for triggering the system change message. If we wait to long, then we get obsolete information which is not what we want.
Tell class to deactivate and unload itself-- two separate events in the module system"
| myCategory |
self release.
self unload.

self superclass ifNotNil:
["If we have no superclass there's nothing to be remembered"
self superclass addObsoleteSubclass: self].

"we add the class to Undeclared so that if references still exist, they will be automatically fixed
if this class is loaded again. We do not check if references exist as it is too slow"
self binding value: nil.
Undeclared declare: self name asSymbol from: Smalltalk globals.
myCategory := self category.
self environment forgetClass: self logged: logged.
self obsolete.
logged ifTrue: [SystemAnnouncer uniqueInstance classRemoved: self fromCategory: myCategory]
]
1 change: 1 addition & 0 deletions dev/src/ExercismPharo110/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #ExercismPharo110 }
2 changes: 1 addition & 1 deletion dev/src/ExercismTestRunner/ExercismTest.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ExercismTest >> resultDebugInfo [
[
aContext isNil or: [
aContext receiver == self and: [
aContext methodSelector == #runCase ] ] ] whileFalse: [
aContext selector == #runCase ] ] ] whileFalse: [
[
writeStream
nextPutAll: aContext printString;
Expand Down