forked from bonzini/gst-visualgst
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddClassUndoCommandTest.st
More file actions
29 lines (23 loc) · 848 Bytes
/
AddClassUndoCommandTest.st
File metadata and controls
29 lines (23 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
TestCase subclass: AddClassUndoCommandTest [
testAddClass [
<category: 'testing'>
| cmd |
cmd := AddClassUndoCommand
add: #Object to: Smalltalk classCategory: 'bar' withSuperclass: Object.
self assert: cmd precondition not.
cmd := AddClassUndoCommand
add: #Foo to: Smalltalk classCategory: Object classCategory withSuperclass: Object.
self assert: cmd precondition.
cmd redo.
self assert: (Smalltalk includesKey: #Foo).
self assert: (Smalltalk at: #Foo) superclass == Object.
self assert: (Smalltalk at: #Foo) classCategory == Object classCategory.
cmd undo.
self assert: (Smalltalk includesKey: #Foo) not.
cmd redo.
self assert: (Smalltalk includesKey: #Foo).
self assert: (Smalltalk at: #Foo) superclass == Object.
self assert: (Smalltalk at: #Foo) classCategory == Object classCategory.
cmd undo
]
]