Skip to content

Commit

Permalink
Use ClassFactoryForTestCase
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan Brichau committed Nov 24, 2023
1 parent 3a4e4bc commit e5fedf3
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
accessing-code
compile: aString in: aClass
^ aClass compile: aString classified: #(accessing)
^ aClass compile: aString classified: #accessing
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
accessing-code
defineClass: aClassSymbol superclass: aSuperSymbol
| class |
model defineClass: aSuperSymbol , ' subclass: #' , aClassSymbol , '
class := factory make: [ :aBuilder |
aBuilder
name: aClassSymbol;
superclass: aSuperSymbol;
package: self category ]

"aSuperSymbol , ' subclass: #' , aClassSymbol , '
instanceVariableNames: ''''
classVariableNames: ''''
poolDictionaries: ''''
category: ''' , self category , ''''.
class := model classNamed: aClassSymbol.
category: ''' , self category , ''''".
"class := model classNamed: aClassSymbol."
environment
addClass: class;
addClass: class theMetaClass.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
running
setUp
super setUp.
factory := ClassFactoryForTestCase new.
model := RBNamespace new.
environment := RBClassEnvironment new
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
running
tearDown

super tearDown.
(Smalltalk organization listAtCategoryNamed: self category) do:[ :e |
SmalltalkImage current removeClassNamed: e ].
factory cleanUp.
"package := (Smalltalk organization packageNamed: self category).
package classes do:[ :e |
SmalltalkImage current removeClassNamed: e name ].
Smalltalk organization
removeCategory: self category
removePackage: package"
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"classvars" : [ ],
"instvars" : [
"model",
"environment"
"environment",
"factory"
],
"name" : "GRSlimeTest",
"type" : "normal"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SystemOrganization addCategory: #'Grease-Tests-Slime'!
self packageOrganizer ensurePackage: #'Grease-Tests-Slime' withTags: #()!

0 comments on commit e5fedf3

Please sign in to comment.