defmastership 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Guardfile +2 -5
- data/config/mutant.yml +2 -1
- data/config/rubocop.yml +20 -8
- data/defmastership.gemspec +4 -14
- data/features/changeref.feature +78 -0
- data/features/definition_checksum.feature +118 -0
- data/features/definition_version.feature +168 -0
- data/features/export.feature +67 -22
- data/features/external_ref_checksum.feature +169 -0
- data/features/external_ref_version.feature +173 -0
- data/features/internal_ref_checksum.feature +77 -0
- data/features/internal_ref_version.feature +81 -0
- data/features/rename_included_files.feature +28 -0
- data/lib/defmastership/app.rb +5 -6
- data/lib/defmastership/comment_filter.rb +2 -0
- data/lib/defmastership/def_type_list.rb +25 -0
- data/lib/defmastership/definition_parser.rb +2 -6
- data/lib/defmastership/document.rb +6 -9
- data/lib/defmastership/modifier/change_ref.rb +11 -34
- data/lib/defmastership/modifier/factory.rb +5 -1
- data/lib/defmastership/modifier/rename_included_files.rb +9 -0
- data/lib/defmastership/modifier/replacement_formatter.rb +37 -0
- data/lib/defmastership/modifier/update_def.rb +5 -1
- data/lib/defmastership/modifier/update_eref_checksum.rb +46 -0
- data/lib/defmastership/modifier/update_eref_common.rb +77 -0
- data/lib/defmastership/modifier/update_eref_version.rb +46 -0
- data/lib/defmastership/modifier/update_iref_checksum.rb +51 -0
- data/lib/defmastership/modifier/update_iref_common.rb +45 -0
- data/lib/defmastership/modifier/update_iref_version.rb +58 -0
- data/lib/defmastership/version.rb +1 -1
- data/spec/spec_helper.rb +11 -10
- data/spec/unit/defmastership/app_spec.rb +32 -19
- data/spec/unit/defmastership/batch_modifier_spec.rb +9 -7
- data/spec/unit/defmastership/def_type_list_spec.rb +22 -0
- data/spec/unit/defmastership/definition_spec.rb +8 -51
- data/spec/unit/defmastership/document_spec.rb +12 -36
- data/spec/unit/defmastership/export/body_formatter_spec.rb +5 -18
- data/spec/unit/defmastership/export/csv/formatter_spec.rb +1 -0
- data/spec/unit/defmastership/export/header_formatter_spec.rb +2 -6
- data/spec/unit/defmastership/hash_spec.rb +2 -0
- data/spec/unit/defmastership/modifier/change_ref_spec.rb +33 -70
- data/spec/unit/defmastership/modifier/factory_spec.rb +40 -17
- data/spec/unit/defmastership/modifier/modifier_common_spec.rb +2 -0
- data/spec/unit/defmastership/modifier/rename_included_files_spec.rb +62 -46
- data/spec/unit/defmastership/modifier/update_def_checksum_spec.rb +2 -9
- data/spec/unit/defmastership/modifier/update_def_spec.rb +76 -21
- data/spec/unit/defmastership/modifier/update_def_version_spec.rb +6 -32
- data/spec/unit/defmastership/modifier/update_eref_checksum_spec.rb +200 -0
- data/spec/unit/defmastership/modifier/update_eref_version_spec.rb +215 -0
- data/spec/unit/defmastership/modifier/update_iref_checksum_spec.rb +133 -0
- data/spec/unit/defmastership/modifier/update_iref_version_spec.rb +162 -0
- data/tasks/code_quality.rake +1 -8
- data/tasks/test.rake +15 -0
- metadata +34 -3
data/features/export.feature
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
Feature: The
|
1
|
+
Feature: The export command
|
2
2
|
As a Responsible of definitions
|
3
3
|
In order to make statistics on definitions
|
4
|
-
I want defmastership to
|
4
|
+
I want defmastership to export definitions from asciidoctor documents
|
5
5
|
|
6
|
-
Scenario:
|
6
|
+
Scenario: Export one definition to CSV
|
7
7
|
Given a file named "toto.adoc" with:
|
8
8
|
"""
|
9
9
|
[define, requirement, TOTO-0001]
|
@@ -21,7 +21,31 @@ Feature: The extract command
|
|
21
21
|
"""
|
22
22
|
And the stdout should not contain anything
|
23
23
|
|
24
|
-
Scenario:
|
24
|
+
Scenario: Export more adoc documents
|
25
|
+
Given a file named "toto.adoc" with:
|
26
|
+
"""
|
27
|
+
[define, requirement, TOTO-0001]
|
28
|
+
--
|
29
|
+
Requirement TOTO-0001
|
30
|
+
--
|
31
|
+
"""
|
32
|
+
And a file named "tutu.adoc" with:
|
33
|
+
"""
|
34
|
+
[define, requirement, TUTU-1000]
|
35
|
+
--
|
36
|
+
Requirement TUTU-1000
|
37
|
+
--
|
38
|
+
"""
|
39
|
+
When I successfully run `defmastership export --output-file my_export.csv toto.adoc tutu.adoc`
|
40
|
+
Then the file "my_export.csv" should contain:
|
41
|
+
"""
|
42
|
+
Type,Reference,Value,Checksum
|
43
|
+
requirement,TOTO-0001,Requirement TOTO-0001,~5524684e
|
44
|
+
requirement,TUTU-1000,Requirement TUTU-1000,~2f52cb8b
|
45
|
+
"""
|
46
|
+
And the stdout should not contain anything
|
47
|
+
|
48
|
+
Scenario: Export to CSV with alternative CSV separator
|
25
49
|
Given a file named "toto.adoc" with:
|
26
50
|
"""
|
27
51
|
[define, requirement, TOTO-0001]
|
@@ -38,7 +62,7 @@ Feature: The extract command
|
|
38
62
|
Second line.";~b86dcbde
|
39
63
|
"""
|
40
64
|
|
41
|
-
Scenario:
|
65
|
+
Scenario: Export one definition with variable to CSV
|
42
66
|
Given a file named "toto.adoc" with:
|
43
67
|
"""
|
44
68
|
:my_variable-with-dash: Variable content
|
@@ -61,7 +85,7 @@ Feature: The extract command
|
|
61
85
|
And the stdout should not contain anything
|
62
86
|
|
63
87
|
|
64
|
-
Scenario:
|
88
|
+
Scenario: Export some definitions to CSV
|
65
89
|
Given a file named "toto.adoc" with:
|
66
90
|
"""
|
67
91
|
[define, requirement, TOTO-0001]
|
@@ -152,7 +176,7 @@ Feature: The extract command
|
|
152
176
|
"""
|
153
177
|
And the stdout should not contain anything
|
154
178
|
|
155
|
-
Scenario: Handle mixes comment and literal blocks
|
179
|
+
Scenario: Handle mixes comment and literal blocks
|
156
180
|
Given a file named "toto.adoc" with:
|
157
181
|
"""
|
158
182
|
[define, requirement, TOTO-0001]
|
@@ -174,7 +198,7 @@ Feature: The extract command
|
|
174
198
|
"""
|
175
199
|
And the stdout should not contain anything
|
176
200
|
|
177
|
-
Scenario:
|
201
|
+
Scenario: Export definition with summary
|
178
202
|
Given a file named "toto.adoc" with:
|
179
203
|
"""
|
180
204
|
[define, requirement, TOTO-0001, A nice summary]
|
@@ -192,7 +216,7 @@ Feature: The extract command
|
|
192
216
|
"""
|
193
217
|
And the stdout should not contain anything
|
194
218
|
|
195
|
-
Scenario:
|
219
|
+
Scenario: Export definition with summary with variable
|
196
220
|
Given a file named "toto.adoc" with:
|
197
221
|
"""
|
198
222
|
:a_variable: summary
|
@@ -211,7 +235,7 @@ Feature: The extract command
|
|
211
235
|
"""
|
212
236
|
And the stdout should not contain anything
|
213
237
|
|
214
|
-
Scenario:
|
238
|
+
Scenario: Export definition with summary including comma
|
215
239
|
Given a file named "toto.adoc" with:
|
216
240
|
"""
|
217
241
|
[define, requirement, TOTO-0001, " A nice, summary " ]
|
@@ -229,7 +253,7 @@ Feature: The extract command
|
|
229
253
|
"""
|
230
254
|
And the stdout should not contain anything
|
231
255
|
|
232
|
-
Scenario:
|
256
|
+
Scenario: Export definition with labels
|
233
257
|
Given a file named "toto.adoc" with:
|
234
258
|
"""
|
235
259
|
[define, requirement, TOTO-0001, [label1, label2]]
|
@@ -248,7 +272,7 @@ Feature: The extract command
|
|
248
272
|
"""
|
249
273
|
And the stdout should not contain anything
|
250
274
|
|
251
|
-
Scenario:
|
275
|
+
Scenario: Export one definition with external ref to CSV
|
252
276
|
Given a file named "toto.adoc" with:
|
253
277
|
"""
|
254
278
|
:eref-implements-prefix: Participate to:
|
@@ -270,7 +294,7 @@ Feature: The extract command
|
|
270
294
|
"""
|
271
295
|
And the stdout should not contain anything
|
272
296
|
|
273
|
-
Scenario:
|
297
|
+
Scenario: Export one definition with external ref (with version and checksum) to CSV
|
274
298
|
Given a file named "toto.adoc" with:
|
275
299
|
"""
|
276
300
|
:eref-implements-prefix: Participate to:
|
@@ -293,7 +317,7 @@ Feature: The extract command
|
|
293
317
|
"""
|
294
318
|
And the stdout should not contain anything
|
295
319
|
|
296
|
-
Scenario:
|
320
|
+
Scenario: Export one definition with missing external ref to CSV
|
297
321
|
Given a file named "toto.adoc" with:
|
298
322
|
"""
|
299
323
|
:eref-implements-prefix: Participate to:
|
@@ -313,7 +337,7 @@ Feature: The extract command
|
|
313
337
|
"""
|
314
338
|
And the stdout should not contain anything
|
315
339
|
|
316
|
-
Scenario:
|
340
|
+
Scenario: Export one definition with external ref without url to CSV
|
317
341
|
Given a file named "toto.adoc" with:
|
318
342
|
"""
|
319
343
|
:eref-implements-prefix: Participate to:
|
@@ -335,7 +359,7 @@ Feature: The extract command
|
|
335
359
|
"""
|
336
360
|
And the stdout should not contain anything
|
337
361
|
|
338
|
-
Scenario:
|
362
|
+
Scenario: Export one definition with external ref to CSV without URL
|
339
363
|
Given a file named "toto.adoc" with:
|
340
364
|
"""
|
341
365
|
:eref-implements-prefix: Participate to:
|
@@ -356,7 +380,7 @@ Feature: The extract command
|
|
356
380
|
SYSTEM-0014"
|
357
381
|
"""
|
358
382
|
|
359
|
-
Scenario:
|
383
|
+
Scenario: Export one definition with internal ref to CSV
|
360
384
|
Given a file named "toto.adoc" with:
|
361
385
|
"""
|
362
386
|
[define, requirement, TOTO-0001]
|
@@ -377,7 +401,28 @@ Feature: The extract command
|
|
377
401
|
"""
|
378
402
|
And the stdout should not contain anything
|
379
403
|
|
380
|
-
Scenario:
|
404
|
+
Scenario: Export one definition with internal ref with version and checksum to CSV
|
405
|
+
Given a file named "toto.adoc" with:
|
406
|
+
"""
|
407
|
+
[define, requirement, TOTO-0001]
|
408
|
+
--
|
409
|
+
Exemple of multiline requirement.
|
410
|
+
Second line: defs:iref[TOTO-0001(a)], defs:iref[TOTO-0123(~12345678)].
|
411
|
+
--
|
412
|
+
please see defs:iref[TOTO-0002(z~12345678)]
|
413
|
+
"""
|
414
|
+
When I successfully run `defmastership export toto.adoc`
|
415
|
+
Then the file "toto.csv" should contain:
|
416
|
+
"""
|
417
|
+
Type,Reference,Value,Checksum,Internal links
|
418
|
+
requirement,TOTO-0001,"Exemple of multiline requirement.
|
419
|
+
Second line: defs:iref[TOTO-0001(a)], defs:iref[TOTO-0123(~12345678)].",~f5f2fbd5,"TOTO-0001(a)
|
420
|
+
TOTO-0123(~12345678)
|
421
|
+
TOTO-0002(z~12345678)"
|
422
|
+
"""
|
423
|
+
And the stdout should not contain anything
|
424
|
+
|
425
|
+
Scenario: Export one definition with attributes to CSV
|
381
426
|
Given a file named "toto.adoc" with:
|
382
427
|
"""
|
383
428
|
:attr-verifiedby-prefix: Verified by:
|
@@ -398,7 +443,7 @@ Feature: The extract command
|
|
398
443
|
"""
|
399
444
|
And the stdout should not contain anything
|
400
445
|
|
401
|
-
Scenario:
|
446
|
+
Scenario: Export one definition with missing attributes to CSV
|
402
447
|
Given a file named "toto.adoc" with:
|
403
448
|
"""
|
404
449
|
:attr-verifiedby-prefix: Verified by:
|
@@ -418,7 +463,7 @@ Feature: The extract command
|
|
418
463
|
"""
|
419
464
|
And the stdout should not contain anything
|
420
465
|
|
421
|
-
Scenario:
|
466
|
+
Scenario: Export one definition with example in it
|
422
467
|
Given a file named "toto.adoc" with:
|
423
468
|
"""
|
424
469
|
[define, requirement, TOTO-0001]
|
@@ -442,7 +487,7 @@ Feature: The extract command
|
|
442
487
|
"""
|
443
488
|
And the stdout should not contain anything
|
444
489
|
|
445
|
-
Scenario:
|
490
|
+
Scenario: Export one definition with single line comment in it
|
446
491
|
Given a file named "toto.adoc" with:
|
447
492
|
"""
|
448
493
|
[define, requirement, TOTO-0001]
|
@@ -458,7 +503,7 @@ Feature: The extract command
|
|
458
503
|
"""
|
459
504
|
And the stdout should not contain anything
|
460
505
|
|
461
|
-
Scenario:
|
506
|
+
Scenario: Export one definition with multi line comment or literal in it
|
462
507
|
Given a file named "toto.adoc" with:
|
463
508
|
"""
|
464
509
|
[define, requirement, TOTO-0001]
|
@@ -0,0 +1,169 @@
|
|
1
|
+
Feature: internal ref checksum
|
2
|
+
As a Responsible of definitions for a given document
|
3
|
+
In order to detect impacts of the modifications of definitions
|
4
|
+
I want defmastership update checksum in definitions internal references
|
5
|
+
|
6
|
+
Scenario Outline: Update one internal ref (<comment>)
|
7
|
+
Given a file named "modifications.yml" with:
|
8
|
+
"""
|
9
|
+
---
|
10
|
+
:update_external_ref_checksum:
|
11
|
+
:type: update_eref_checksum
|
12
|
+
:config:
|
13
|
+
:eref_type: implements
|
14
|
+
:ref_document: reference.adoc
|
15
|
+
"""
|
16
|
+
And a file named "reference.adoc" with:
|
17
|
+
"""
|
18
|
+
[define, requirement, TOTO-TEMP-XXX1]
|
19
|
+
--
|
20
|
+
the requirement value.
|
21
|
+
--
|
22
|
+
"""
|
23
|
+
And a file named "thedoc.adoc" with:
|
24
|
+
"""
|
25
|
+
defs:eref[implements, [TOTO-TEMP-XXX1<before>]]
|
26
|
+
"""
|
27
|
+
When I successfully run `defmastership modify --modifications update_external_ref_checksum thedoc.adoc`
|
28
|
+
Then the stdout should not contain anything
|
29
|
+
And the file "thedoc.adoc" should contain:
|
30
|
+
"""
|
31
|
+
defs:eref[implements, [TOTO-TEMP-XXX1<after>]]
|
32
|
+
"""
|
33
|
+
|
34
|
+
Examples:
|
35
|
+
| before | after | comment |
|
36
|
+
| | (~244eed18) | No initial checksum |
|
37
|
+
| (~abcd1234) | (~244eed18) | With initial checksum |
|
38
|
+
| (a) | (a~244eed18) | With a version |
|
39
|
+
| (a~abcd1234) | (a~244eed18) | With a version and a checksum |
|
40
|
+
|
41
|
+
Scenario: Update more external refs with multiple reference doc
|
42
|
+
Given a file named "modifications.yml" with:
|
43
|
+
"""
|
44
|
+
---
|
45
|
+
:update_external_ref_checksum:
|
46
|
+
:type: update_eref_checksum
|
47
|
+
:config:
|
48
|
+
:eref_type: implements
|
49
|
+
:ref_document:
|
50
|
+
- reference1.adoc
|
51
|
+
- reference2.adoc
|
52
|
+
"""
|
53
|
+
And a file named "reference1.adoc" with:
|
54
|
+
"""
|
55
|
+
[define, requirement, TOTO-TEMP-XXX1]
|
56
|
+
--
|
57
|
+
the requirement value.
|
58
|
+
--
|
59
|
+
"""
|
60
|
+
And a file named "reference2.adoc" with:
|
61
|
+
"""
|
62
|
+
[define, requirement, TOTO-TEMP-XXX2]
|
63
|
+
--
|
64
|
+
Another requirement value.
|
65
|
+
--
|
66
|
+
"""
|
67
|
+
And a file named "thedoc.adoc" with:
|
68
|
+
"""
|
69
|
+
defs:eref[implements, [TOTO-TEMP-XXX1, TOTO-TEMP-XXX2]]
|
70
|
+
"""
|
71
|
+
When I successfully run `defmastership modify --modifications update_external_ref_checksum thedoc.adoc`
|
72
|
+
Then the stdout should not contain anything
|
73
|
+
And the file "thedoc.adoc" should contain:
|
74
|
+
"""
|
75
|
+
defs:eref[implements, [TOTO-TEMP-XXX1(~244eed18), TOTO-TEMP-XXX2(~a3c1c965)]]
|
76
|
+
"""
|
77
|
+
|
78
|
+
Scenario: Not matching eref_type
|
79
|
+
Given a file named "modifications.yml" with:
|
80
|
+
"""
|
81
|
+
---
|
82
|
+
:update_external_ref_checksum:
|
83
|
+
:type: update_eref_checksum
|
84
|
+
:config:
|
85
|
+
:eref_type: implements
|
86
|
+
:ref_document: reference.adoc
|
87
|
+
"""
|
88
|
+
And a file named "reference.adoc" with:
|
89
|
+
"""
|
90
|
+
[define, requirement, TOTO-TEMP-XXX1]
|
91
|
+
--
|
92
|
+
the requirement value.
|
93
|
+
--
|
94
|
+
"""
|
95
|
+
And a file named "thedoc.adoc" with:
|
96
|
+
"""
|
97
|
+
defs:eref[implements, [TOTO-TEMP-XXX1]]
|
98
|
+
defs:eref[whatever, [TOTO-TEMP-XXX1]]
|
99
|
+
"""
|
100
|
+
When I successfully run `defmastership modify --modifications update_external_ref_checksum thedoc.adoc`
|
101
|
+
Then the stdout should not contain anything
|
102
|
+
And the file "thedoc.adoc" should contain:
|
103
|
+
"""
|
104
|
+
defs:eref[implements, [TOTO-TEMP-XXX1(~244eed18)]]
|
105
|
+
defs:eref[whatever, [TOTO-TEMP-XXX1]]
|
106
|
+
"""
|
107
|
+
|
108
|
+
Scenario: No eref_type
|
109
|
+
Given a file named "modifications.yml" with:
|
110
|
+
"""
|
111
|
+
---
|
112
|
+
:update_external_ref_checksum:
|
113
|
+
:type: update_eref_checksum
|
114
|
+
:config:
|
115
|
+
:ref_document: reference.adoc
|
116
|
+
"""
|
117
|
+
And a file named "reference.adoc" with:
|
118
|
+
"""
|
119
|
+
[define, requirement, TOTO-TEMP-XXX1]
|
120
|
+
--
|
121
|
+
the requirement value.
|
122
|
+
--
|
123
|
+
"""
|
124
|
+
And a file named "thedoc.adoc" with:
|
125
|
+
"""
|
126
|
+
defs:eref[implements, [TOTO-TEMP-XXX1]]
|
127
|
+
defs:eref[whatever, [TOTO-TEMP-XXX1]]
|
128
|
+
"""
|
129
|
+
When I successfully run `defmastership modify --modifications update_external_ref_checksum thedoc.adoc`
|
130
|
+
Then the stdout should not contain anything
|
131
|
+
And the file "thedoc.adoc" should contain:
|
132
|
+
"""
|
133
|
+
defs:eref[implements, [TOTO-TEMP-XXX1(~244eed18)]]
|
134
|
+
defs:eref[whatever, [TOTO-TEMP-XXX1(~244eed18)]]
|
135
|
+
"""
|
136
|
+
|
137
|
+
Scenario: eref_type with a list
|
138
|
+
Given a file named "modifications.yml" with:
|
139
|
+
"""
|
140
|
+
---
|
141
|
+
:update_external_ref_checksum:
|
142
|
+
:type: update_eref_checksum
|
143
|
+
:config:
|
144
|
+
:eref_type:
|
145
|
+
- implements
|
146
|
+
- pouet
|
147
|
+
:ref_document: reference.adoc
|
148
|
+
"""
|
149
|
+
And a file named "reference.adoc" with:
|
150
|
+
"""
|
151
|
+
[define, requirement, TOTO-TEMP-XXX1]
|
152
|
+
--
|
153
|
+
the requirement value.
|
154
|
+
--
|
155
|
+
"""
|
156
|
+
And a file named "thedoc.adoc" with:
|
157
|
+
"""
|
158
|
+
defs:eref[implements, [TOTO-TEMP-XXX1]]
|
159
|
+
defs:eref[whatever, [TOTO-TEMP-XXX1]]
|
160
|
+
defs:eref[pouet, [TOTO-TEMP-XXX1]]
|
161
|
+
"""
|
162
|
+
When I successfully run `defmastership modify --modifications update_external_ref_checksum thedoc.adoc`
|
163
|
+
Then the stdout should not contain anything
|
164
|
+
And the file "thedoc.adoc" should contain:
|
165
|
+
"""
|
166
|
+
defs:eref[implements, [TOTO-TEMP-XXX1(~244eed18)]]
|
167
|
+
defs:eref[whatever, [TOTO-TEMP-XXX1]]
|
168
|
+
defs:eref[pouet, [TOTO-TEMP-XXX1(~244eed18)]]
|
169
|
+
"""
|
@@ -0,0 +1,173 @@
|
|
1
|
+
Feature: internal ref version
|
2
|
+
As a Responsible of definitions for a given document
|
3
|
+
In order to detect impacts of the modifications of definitions
|
4
|
+
I want defmastership update version in definitions internal references
|
5
|
+
|
6
|
+
Scenario Outline: Update one internal ref (<comment>)
|
7
|
+
Given a file named "modifications.yml" with:
|
8
|
+
"""
|
9
|
+
---
|
10
|
+
:update_external_ref_version:
|
11
|
+
:type: update_eref_version
|
12
|
+
:config:
|
13
|
+
:eref_type: implements
|
14
|
+
:ref_document: reference.adoc
|
15
|
+
"""
|
16
|
+
And a file named "reference.adoc" with:
|
17
|
+
"""
|
18
|
+
[define, requirement, TOTO-TEMP-XXX1<ref version>]
|
19
|
+
--
|
20
|
+
the requirement value.
|
21
|
+
--
|
22
|
+
"""
|
23
|
+
And a file named "thedoc.adoc" with:
|
24
|
+
"""
|
25
|
+
defs:eref[implements, [TOTO-TEMP-XXX1<before>]]
|
26
|
+
"""
|
27
|
+
When I successfully run `defmastership modify --modifications update_external_ref_version thedoc.adoc`
|
28
|
+
Then the stdout should not contain anything
|
29
|
+
And the file "thedoc.adoc" should contain:
|
30
|
+
"""
|
31
|
+
defs:eref[implements, [TOTO-TEMP-XXX1<after>]]
|
32
|
+
"""
|
33
|
+
|
34
|
+
Examples:
|
35
|
+
| ref version | before | after | comment |
|
36
|
+
| (z) | | (z) | No initial version |
|
37
|
+
| (z) | (a) | (z) | With initial version |
|
38
|
+
| (z) | (~abcd1234) | (z~abcd1234) | With a version |
|
39
|
+
| (z) | (a~abcd1234) | (z~abcd1234) | With a version and a version |
|
40
|
+
| | | | No initial version |
|
41
|
+
| | (a) | | With initial version |
|
42
|
+
| | (~abcd1234) | (~abcd1234) | With a version |
|
43
|
+
| | (a~abcd1234) | (~abcd1234) | With a version and a version |
|
44
|
+
|
45
|
+
Scenario: Update more external refs with multiple reference doc
|
46
|
+
Given a file named "modifications.yml" with:
|
47
|
+
"""
|
48
|
+
---
|
49
|
+
:update_external_ref_version:
|
50
|
+
:type: update_eref_version
|
51
|
+
:config:
|
52
|
+
:eref_type: implements
|
53
|
+
:ref_document:
|
54
|
+
- reference1.adoc
|
55
|
+
- reference2.adoc
|
56
|
+
"""
|
57
|
+
And a file named "reference1.adoc" with:
|
58
|
+
"""
|
59
|
+
[define, requirement, TOTO-TEMP-XXX1(a)]
|
60
|
+
--
|
61
|
+
the requirement value.
|
62
|
+
--
|
63
|
+
"""
|
64
|
+
And a file named "reference2.adoc" with:
|
65
|
+
"""
|
66
|
+
[define, requirement, TOTO-TEMP-XXX2(z)]
|
67
|
+
--
|
68
|
+
Another requirement value.
|
69
|
+
--
|
70
|
+
"""
|
71
|
+
And a file named "thedoc.adoc" with:
|
72
|
+
"""
|
73
|
+
defs:eref[implements, [TOTO-TEMP-XXX1, TOTO-TEMP-XXX2]]
|
74
|
+
"""
|
75
|
+
When I successfully run `defmastership modify --modifications update_external_ref_version thedoc.adoc`
|
76
|
+
Then the stdout should not contain anything
|
77
|
+
And the file "thedoc.adoc" should contain:
|
78
|
+
"""
|
79
|
+
defs:eref[implements, [TOTO-TEMP-XXX1(a), TOTO-TEMP-XXX2(z)]]
|
80
|
+
"""
|
81
|
+
|
82
|
+
Scenario: Not matching eref_type
|
83
|
+
Given a file named "modifications.yml" with:
|
84
|
+
"""
|
85
|
+
---
|
86
|
+
:update_external_ref_version:
|
87
|
+
:type: update_eref_version
|
88
|
+
:config:
|
89
|
+
:eref_type: implements
|
90
|
+
:ref_document: reference.adoc
|
91
|
+
"""
|
92
|
+
And a file named "reference.adoc" with:
|
93
|
+
"""
|
94
|
+
[define, requirement, TOTO-TEMP-XXX1(a)]
|
95
|
+
--
|
96
|
+
the requirement value.
|
97
|
+
--
|
98
|
+
"""
|
99
|
+
And a file named "thedoc.adoc" with:
|
100
|
+
"""
|
101
|
+
defs:eref[implements, [TOTO-TEMP-XXX1]]
|
102
|
+
defs:eref[whatever, [TOTO-TEMP-XXX1]]
|
103
|
+
"""
|
104
|
+
When I successfully run `defmastership modify --modifications update_external_ref_version thedoc.adoc`
|
105
|
+
Then the stdout should not contain anything
|
106
|
+
And the file "thedoc.adoc" should contain:
|
107
|
+
"""
|
108
|
+
defs:eref[implements, [TOTO-TEMP-XXX1(a)]]
|
109
|
+
defs:eref[whatever, [TOTO-TEMP-XXX1]]
|
110
|
+
"""
|
111
|
+
|
112
|
+
Scenario: No eref_type
|
113
|
+
Given a file named "modifications.yml" with:
|
114
|
+
"""
|
115
|
+
---
|
116
|
+
:update_external_ref_version:
|
117
|
+
:type: update_eref_version
|
118
|
+
:config:
|
119
|
+
:ref_document: reference.adoc
|
120
|
+
"""
|
121
|
+
And a file named "reference.adoc" with:
|
122
|
+
"""
|
123
|
+
[define, requirement, TOTO-TEMP-XXX1(a)]
|
124
|
+
--
|
125
|
+
the requirement value.
|
126
|
+
--
|
127
|
+
"""
|
128
|
+
And a file named "thedoc.adoc" with:
|
129
|
+
"""
|
130
|
+
defs:eref[implements, [TOTO-TEMP-XXX1]]
|
131
|
+
defs:eref[whatever, [TOTO-TEMP-XXX1]]
|
132
|
+
"""
|
133
|
+
When I successfully run `defmastership modify --modifications update_external_ref_version thedoc.adoc`
|
134
|
+
Then the stdout should not contain anything
|
135
|
+
And the file "thedoc.adoc" should contain:
|
136
|
+
"""
|
137
|
+
defs:eref[implements, [TOTO-TEMP-XXX1(a)]]
|
138
|
+
defs:eref[whatever, [TOTO-TEMP-XXX1(a)]]
|
139
|
+
"""
|
140
|
+
|
141
|
+
Scenario: eref_type with a list
|
142
|
+
Given a file named "modifications.yml" with:
|
143
|
+
"""
|
144
|
+
---
|
145
|
+
:update_external_ref_version:
|
146
|
+
:type: update_eref_version
|
147
|
+
:config:
|
148
|
+
:eref_type:
|
149
|
+
- implements
|
150
|
+
- pouet
|
151
|
+
:ref_document: reference.adoc
|
152
|
+
"""
|
153
|
+
And a file named "reference.adoc" with:
|
154
|
+
"""
|
155
|
+
[define, requirement, TOTO-TEMP-XXX1(a)]
|
156
|
+
--
|
157
|
+
the requirement value.
|
158
|
+
--
|
159
|
+
"""
|
160
|
+
And a file named "thedoc.adoc" with:
|
161
|
+
"""
|
162
|
+
defs:eref[implements, [TOTO-TEMP-XXX1]]
|
163
|
+
defs:eref[whatever, [TOTO-TEMP-XXX1]]
|
164
|
+
defs:eref[pouet, [TOTO-TEMP-XXX1]]
|
165
|
+
"""
|
166
|
+
When I successfully run `defmastership modify --modifications update_external_ref_version thedoc.adoc`
|
167
|
+
Then the stdout should not contain anything
|
168
|
+
And the file "thedoc.adoc" should contain:
|
169
|
+
"""
|
170
|
+
defs:eref[implements, [TOTO-TEMP-XXX1(a)]]
|
171
|
+
defs:eref[whatever, [TOTO-TEMP-XXX1]]
|
172
|
+
defs:eref[pouet, [TOTO-TEMP-XXX1(a)]]
|
173
|
+
"""
|
@@ -0,0 +1,77 @@
|
|
1
|
+
Feature: internal ref checksum
|
2
|
+
As a Responsible of definitions for a given document
|
3
|
+
In order to detect impacts of the modifications of definitions
|
4
|
+
I want defmastership update checksum in definitions internal references
|
5
|
+
|
6
|
+
Scenario Outline: Update one internal ref (<comment>)
|
7
|
+
Given a file named "modifications.yml" with:
|
8
|
+
"""
|
9
|
+
---
|
10
|
+
:update_internal_ref_checksum:
|
11
|
+
:type: update_iref_checksum
|
12
|
+
"""
|
13
|
+
And a file named "thedoc.adoc" with:
|
14
|
+
"""
|
15
|
+
[define, requirement, TOTO-TEMP-XXX1]
|
16
|
+
--
|
17
|
+
the requirement value.
|
18
|
+
--
|
19
|
+
|
20
|
+
See defs:iref[TOTO-TEMP-XXX1<before>]
|
21
|
+
"""
|
22
|
+
When I successfully run `defmastership modify --modifications update_internal_ref_checksum thedoc.adoc`
|
23
|
+
Then the stdout should not contain anything
|
24
|
+
And the file "thedoc.adoc" should contain:
|
25
|
+
"""
|
26
|
+
[define, requirement, TOTO-TEMP-XXX1]
|
27
|
+
--
|
28
|
+
the requirement value.
|
29
|
+
--
|
30
|
+
|
31
|
+
See defs:iref[TOTO-TEMP-XXX1<after>]
|
32
|
+
"""
|
33
|
+
|
34
|
+
Examples:
|
35
|
+
| before | after | comment |
|
36
|
+
| | (~244eed18) | No initial checksum |
|
37
|
+
| (~abcd1234) | (~244eed18) | With initial checksum |
|
38
|
+
| (a) | (a~244eed18) | With a version |
|
39
|
+
| (a~abcd1234) | (a~244eed18) | With a version and a checksum |
|
40
|
+
|
41
|
+
Scenario: Update more internal refs
|
42
|
+
Given a file named "modifications.yml" with:
|
43
|
+
"""
|
44
|
+
---
|
45
|
+
:update_internal_ref_checksum:
|
46
|
+
:type: update_iref_checksum
|
47
|
+
"""
|
48
|
+
And a file named "thedoc.adoc" with:
|
49
|
+
"""
|
50
|
+
[define, requirement, TOTO-TEMP-XXX1]
|
51
|
+
--
|
52
|
+
the requirement value.
|
53
|
+
--
|
54
|
+
|
55
|
+
[define, requirement, TOTO-TEMP-XXX2]
|
56
|
+
--
|
57
|
+
Another requirement value.
|
58
|
+
--
|
59
|
+
|
60
|
+
See defs:iref[TOTO-TEMP-XXX1] and defs:iref[TOTO-TEMP-XXX2]
|
61
|
+
"""
|
62
|
+
When I successfully run `defmastership modify --modifications update_internal_ref_checksum thedoc.adoc`
|
63
|
+
Then the stdout should not contain anything
|
64
|
+
And the file "thedoc.adoc" should contain:
|
65
|
+
"""
|
66
|
+
[define, requirement, TOTO-TEMP-XXX1]
|
67
|
+
--
|
68
|
+
the requirement value.
|
69
|
+
--
|
70
|
+
|
71
|
+
[define, requirement, TOTO-TEMP-XXX2]
|
72
|
+
--
|
73
|
+
Another requirement value.
|
74
|
+
--
|
75
|
+
|
76
|
+
See defs:iref[TOTO-TEMP-XXX1(~244eed18)] and defs:iref[TOTO-TEMP-XXX2(~a3c1c965)]
|
77
|
+
"""
|