author | Claus Gittinger <cg@exept.de> |
Tue, 08 May 2018 19:54:33 +0200 | |
changeset 1042 | 3b8c88c55251 |
parent 820 | 0af32f3fb90e |
child 1118 | 1cd9e0a3805b |
permissions | -rw-r--r-- |
5 | 1 |
"{ Package: 'stx:goodies/monticello/test' }" |
2 |
||
3 |
MCTestCase subclass:#MCChangeNotificationTest |
|
4 |
instanceVariableNames:'workingCopy' |
|
5 |
classVariableNames:'' |
|
6 |
poolDictionaries:'' |
|
820
0af32f3fb90e
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
7 |
category:'SCM-Monticello-Tests' |
5 | 8 |
! |
9 |
||
10 |
||
11 |
!MCChangeNotificationTest methodsFor:'events'! |
|
12 |
||
13 |
modifiedEventFor: aSelector ofClass: aClass |
|
14 |
| method | |
|
15 |
method := aClass compiledMethodAt: aSelector. |
|
16 |
^ ModifiedEvent |
|
17 |
methodChangedFrom: method |
|
18 |
to: method |
|
19 |
selector: aSelector |
|
20 |
inClass: aClass. |
|
21 |
! ! |
|
22 |
||
23 |
!MCChangeNotificationTest methodsFor:'private'! |
|
24 |
||
25 |
foreignMethod |
|
26 |
"see testForeignMethodModified" |
|
27 |
! ! |
|
28 |
||
29 |
!MCChangeNotificationTest methodsFor:'running'! |
|
30 |
||
31 |
setUp |
|
32 |
workingCopy _ MCWorkingCopy forPackage: self mockPackage. |
|
33 |
||
34 |
! |
|
35 |
||
36 |
tearDown |
|
37 |
workingCopy unregister |
|
38 |
! ! |
|
39 |
||
40 |
!MCChangeNotificationTest methodsFor:'tests'! |
|
41 |
||
42 |
testCoreMethodModified |
|
43 |
| event | |
|
44 |
workingCopy modified: false. |
|
45 |
event := self modifiedEventFor: #one ofClass: self mockClassA. |
|
46 |
MCWorkingCopy methodModified: event. |
|
47 |
self assert: workingCopy modified |
|
48 |
! |
|
49 |
||
50 |
testExtMethodModified |
|
51 |
| event mref | |
|
52 |
workingCopy modified: false. |
|
53 |
mref := workingCopy packageInfo extensionMethods first. |
|
54 |
event := self modifiedEventFor: mref methodSymbol ofClass: mref actualClass. |
|
55 |
MCWorkingCopy methodModified: event. |
|
56 |
self assert: workingCopy modified |
|
57 |
! |
|
58 |
||
59 |
testForeignMethodModified |
|
60 |
| event | |
|
61 |
workingCopy modified: false. |
|
62 |
event := self modifiedEventFor: #foreignMethod ofClass: self class. |
|
63 |
MCWorkingCopy methodModified: event. |
|
64 |
self deny: workingCopy modified |
|
65 |
! ! |
|
66 |
||
67 |
!MCChangeNotificationTest class methodsFor:'documentation'! |
|
68 |
||
69 |
version |
|
820
0af32f3fb90e
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
70 |
^ '$Header: /cvs/stx/stx/goodies/monticello/test/MCChangeNotificationTest.st,v 1.2 2013-05-29 00:02:05 vrany Exp $' |
5 | 71 |
! ! |
820
0af32f3fb90e
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
72 |