author | vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177 |
Wed, 14 Nov 2012 01:15:30 +0000 | |
changeset 46 | d5a192b11a1a |
parent 40 | e3699c0b00f9 |
child 49 | ffb879bfafe7 |
permissions | -rw-r--r-- |
34 | 1 |
"{ Package: 'stx:libscm/mercurial' }" |
2 |
||
3 |
TestCase subclass:#HGTests |
|
4 |
instanceVariableNames:'repositories' |
|
5 |
classVariableNames:'' |
|
6 |
poolDictionaries:'' |
|
7 |
category:'SCM-Mercurial-Core-Tests' |
|
8 |
! |
|
9 |
||
10 |
||
11 |
!HGTests class methodsFor:'accessing'! |
|
12 |
||
13 |
resources |
|
14 |
^Array with: HGRepositoriesResource |
|
15 |
||
16 |
"Created: / 19-09-2012 / 18:55:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
17 |
"Modified: / 17-10-2012 / 13:01:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
18 |
! ! |
|
19 |
||
20 |
!HGTests methodsFor:'accessing'! |
|
21 |
||
22 |
repositoryNamed: nm |
|
23 |
| dir | |
|
24 |
||
25 |
dir := HGRepositoriesResource current directoryForRepositoryNamed: nm. |
|
26 |
repositories add: dir. |
|
27 |
^HGRepository on: dir. |
|
28 |
||
29 |
"Created: / 19-09-2012 / 19:04:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
30 |
"Modified: / 17-10-2012 / 13:28:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
31 |
! ! |
|
32 |
||
33 |
!HGTests methodsFor:'private'! |
|
34 |
||
35 |
performTest |
|
36 |
||
37 |
GitCommitterQuery answer: (GitSignature name: self class name email: (self class name , '@nowhere')) do:[ |
|
38 |
super performTest |
|
39 |
]. |
|
40 |
||
41 |
"Created: / 30-09-2012 / 10:02:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
42 |
! ! |
|
43 |
||
44 |
!HGTests methodsFor:'running'! |
|
45 |
||
46 |
setUp |
|
47 |
||
48 |
repositories := OrderedCollection new. |
|
49 |
||
50 |
"Created: / 19-09-2012 / 19:01:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
51 |
! |
|
52 |
||
53 |
tearDown |
|
54 |
||
55 |
repositories do:[:e| |
|
56 |
[ |
|
57 |
e asFilename recursiveRemove |
|
58 |
] on: Error do:[ |
|
59 |
"Stupid windows" |
|
60 |
] |
|
61 |
]. |
|
62 |
||
63 |
"Created: / 19-09-2012 / 19:03:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
64 |
"Modified: / 30-09-2012 / 05:26:48 / jv" |
|
65 |
! ! |
|
66 |
||
67 |
!HGTests methodsFor:'tests - basic workflow'! |
|
68 |
||
69 |
test_01a |
|
70 |
||
71 |
"Test modification of working copy and commit back" |
|
72 |
||
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
73 |
| repo wc f1_txt oldcs currentcs | |
34 | 74 |
|
75 |
repo := self repositoryNamed: 'test_repo_01'. |
|
76 |
" |
|
77 |
UserPreferences fileBrowserClass openOn: repo directory. |
|
78 |
" |
|
79 |
wc := repo workingCopy. |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
80 |
oldcs := wc changeset. |
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
81 |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
82 |
self assert: oldcs id revno == 4. |
34 | 83 |
|
84 |
"Modify some file" |
|
38
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
85 |
f1_txt := wc / 'f1.txt'. |
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
86 |
self assert: f1_txt isModified not. |
34 | 87 |
|
38
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
88 |
f1_txt writingFileDo:[:s| |
34 | 89 |
s nextPutAll: 'modified from test_01a'. |
90 |
]. |
|
38
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
91 |
self assert: f1_txt isModified. |
34 | 92 |
|
93 |
wc commit: 'test_01a commit 1'. |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
94 |
currentcs := wc changeset. |
34 | 95 |
|
39
10e693b3e034
- Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
96 |
self assert: f1_txt isModified not. |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
97 |
self assert: currentcs id revno == 5. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
98 |
self assert: currentcs parent1 = oldcs. |
39
10e693b3e034
- Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
99 |
|
34 | 100 |
"Created: / 19-09-2012 / 23:06:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
101 |
"Modified: / 13-11-2012 / 21:48:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
34 | 102 |
! ! |
103 |
||
104 |
!HGTests class methodsFor:'documentation'! |
|
105 |
||
106 |
version_SVN |
|
107 |
^ '$Id:: $' |
|
108 |
! ! |