|
1 "{ Package: 'stx:goodies/monticello' }" |
|
2 |
|
3 MCTestCase subclass:#MCChangeNotificationTest |
|
4 instanceVariableNames:'workingCopy' |
|
5 classVariableNames:'' |
|
6 poolDictionaries:'' |
|
7 category:'Monticello-Tests' |
|
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 |
|
24 !MCChangeNotificationTest methodsFor:'private'! |
|
25 |
|
26 foreignMethod |
|
27 "see testForeignMethodModified" |
|
28 ! ! |
|
29 |
|
30 !MCChangeNotificationTest methodsFor:'running'! |
|
31 |
|
32 setUp |
|
33 workingCopy := MCWorkingCopy forPackage: self mockPackage. |
|
34 |
|
35 ! |
|
36 |
|
37 tearDown |
|
38 workingCopy unregister |
|
39 ! ! |
|
40 |
|
41 !MCChangeNotificationTest methodsFor:'tests'! |
|
42 |
|
43 testCoreMethodModified |
|
44 | event | |
|
45 workingCopy modified: false. |
|
46 event := self modifiedEventFor: #one ofClass: self mockClassA. |
|
47 MCWorkingCopy methodModified: event. |
|
48 self assert: workingCopy modified |
|
49 ! |
|
50 |
|
51 testExtMethodModified |
|
52 | event mref | |
|
53 workingCopy modified: false. |
|
54 mref := workingCopy packageInfo extensionMethods first. |
|
55 event := self modifiedEventFor: mref methodSymbol ofClass: mref actualClass. |
|
56 MCWorkingCopy methodModified: event. |
|
57 self assert: workingCopy modified |
|
58 ! |
|
59 |
|
60 testForeignMethodModified |
|
61 | event | |
|
62 workingCopy modified: false. |
|
63 event := self modifiedEventFor: #foreignMethod ofClass: self class. |
|
64 MCWorkingCopy methodModified: event. |
|
65 self deny: workingCopy modified |
|
66 ! ! |
|
67 |
|
68 !MCChangeNotificationTest class methodsFor:'documentation'! |
|
69 |
|
70 version |
|
71 ^ '$Header: /cvs/stx/stx/goodies/monticello/MCChangeNotificationTest.st,v 1.1 2011-08-20 12:25:29 cg Exp $' |
|
72 ! |
|
73 |
|
74 version_CVS |
|
75 ^ '$Header: /cvs/stx/stx/goodies/monticello/MCChangeNotificationTest.st,v 1.1 2011-08-20 12:25:29 cg Exp $' |
|
76 ! |
|
77 |
|
78 version_SVN |
|
79 ^ '§Id: MCChangeNotificationTest.st 5 2010-08-29 07:30:29Z vranyj1 §' |
|
80 ! ! |