defmastership 1.3.5 → 1.3.7
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/Gemfile +1 -1
- data/config/rubocop.yml +4 -0
- data/features/definition_version.feature +41 -0
- data/features/export.feature +53 -15
- data/features/step_definitions/git_steps.rb +30 -0
- data/features/support/env.rb +14 -13
- data/lib/defmastership/config_preserver.rb +1 -1
- data/lib/defmastership/document.rb +1 -0
- data/lib/defmastership/modifier/modifier_common.rb +1 -1
- data/lib/defmastership/modifier/update_def_version.rb +27 -1
- data/lib/defmastership/version.rb +1 -1
- data/spec/unit/defmastership/config_preserver_spec.rb +12 -4
- data/spec/unit/defmastership/document_spec.rb +24 -0
- data/spec/unit/defmastership/modifier/update_def_version_spec.rb +182 -3
- data/spec/unit/defmastership/modifier/update_iref_checksum_spec.rb +11 -8
- data/spec/unit/defmastership/modifier/update_iref_version_spec.rb +11 -8
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1e4fb0225a55bdddfb2c4f0c3dbca650f991c9c018ea1d80bd9f6b7481b9e8b2
|
|
4
|
+
data.tar.gz: d70ae41ef99b5437241cec107f99ed924be71419c3c2c704e52035367c06c8bd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b698312e2bd57eab8331876ec1b4284a682e319d870c037b21272467c1b6e0e44e822eb49228dbc8edfe34c1916c3593eebc294c5611b49605cebb1fc3eb0336
|
|
7
|
+
data.tar.gz: f24030b68f490ebe51fe60d0573876e3e9388c077ef7f1ee02561341db96a22955cd3071ffe2c33857e43b330f08fb19aa7d0b3bc0f413486b765499550cffcb
|
data/Gemfile
CHANGED
data/config/rubocop.yml
CHANGED
|
@@ -221,6 +221,47 @@ Feature: definitions version
|
|
|
221
221
|
:ref_tag: THE_TAG
|
|
222
222
|
"""
|
|
223
223
|
|
|
224
|
+
Scenario: Update explicit version based on git tag with definitions inside a git submodule
|
|
225
|
+
Given I initialize a git repo in "submodule_origin"
|
|
226
|
+
And a file named "submodule_origin/ref_doc.adoc" with:
|
|
227
|
+
"""
|
|
228
|
+
[define, requirement, TOTO-0001]
|
|
229
|
+
--
|
|
230
|
+
initial text.
|
|
231
|
+
--
|
|
232
|
+
"""
|
|
233
|
+
And I add and commit the changes in repo "submodule_origin"
|
|
234
|
+
And I initialize a git repo
|
|
235
|
+
And I set the environment variable "GIT_ALLOW_PROTOCOL" to "file"
|
|
236
|
+
And I add the repo "submodule_origin" as a submodule "submodule"
|
|
237
|
+
And I set the "THE_TAG" tag
|
|
238
|
+
And a file named "submodule/ref_doc.adoc" with:
|
|
239
|
+
"""
|
|
240
|
+
[define, requirement, TOTO-0001(whatever)]
|
|
241
|
+
--
|
|
242
|
+
modified text.
|
|
243
|
+
--
|
|
244
|
+
"""
|
|
245
|
+
And a file named "modifications.yml" with:
|
|
246
|
+
"""
|
|
247
|
+
---
|
|
248
|
+
:update_requirement_version:
|
|
249
|
+
:type: update_def_version
|
|
250
|
+
:config:
|
|
251
|
+
:def_type: requirement
|
|
252
|
+
:first_version: a
|
|
253
|
+
:ref_tag: 'THE_TAG'
|
|
254
|
+
"""
|
|
255
|
+
And I set the environment variable "GIT_ALLOW_PROTOCOL" to "file"
|
|
256
|
+
When I successfully run `defmastership modify --modifications update_requirement_version submodule/ref_doc.adoc`
|
|
257
|
+
Then the file "submodule/ref_doc.adoc" should contain:
|
|
258
|
+
"""
|
|
259
|
+
[define, requirement, TOTO-0001(a)]
|
|
260
|
+
--
|
|
261
|
+
modified text.
|
|
262
|
+
--
|
|
263
|
+
"""
|
|
264
|
+
|
|
224
265
|
Scenario: Update explicit version based on git tag on a different git repo
|
|
225
266
|
And a file named "defmastership-example.adoc" with:
|
|
226
267
|
"""
|
data/features/export.feature
CHANGED
|
@@ -9,6 +9,7 @@ Feature: The export command
|
|
|
9
9
|
[define, requirement, TOTO-0001]
|
|
10
10
|
--
|
|
11
11
|
Exemple of multiline requirement.
|
|
12
|
+
|
|
12
13
|
Second line.
|
|
13
14
|
--
|
|
14
15
|
"""
|
|
@@ -17,7 +18,8 @@ Feature: The export command
|
|
|
17
18
|
"""
|
|
18
19
|
Type,Reference,Value,Checksum
|
|
19
20
|
requirement,TOTO-0001,"Exemple of multiline requirement.
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
Second line.",~78e36874
|
|
21
23
|
"""
|
|
22
24
|
And the stdout should not contain anything
|
|
23
25
|
|
|
@@ -51,6 +53,7 @@ Feature: The export command
|
|
|
51
53
|
[define, requirement, TOTO-0001]
|
|
52
54
|
--
|
|
53
55
|
Exemple of multiline requirement.
|
|
56
|
+
|
|
54
57
|
Second line.
|
|
55
58
|
--
|
|
56
59
|
"""
|
|
@@ -59,7 +62,8 @@ Feature: The export command
|
|
|
59
62
|
"""
|
|
60
63
|
Type;Reference;Value;Checksum
|
|
61
64
|
requirement;TOTO-0001;"Exemple of multiline requirement.
|
|
62
|
-
|
|
65
|
+
|
|
66
|
+
Second line.";~78e36874
|
|
63
67
|
"""
|
|
64
68
|
|
|
65
69
|
Scenario: Export one definition with variable to CSV
|
|
@@ -91,6 +95,7 @@ Feature: The export command
|
|
|
91
95
|
[define, requirement, TOTO-0001]
|
|
92
96
|
--
|
|
93
97
|
Exemple of multiline requirement.
|
|
98
|
+
|
|
94
99
|
Second line.
|
|
95
100
|
--
|
|
96
101
|
[define, something_else, TOTO-0003]
|
|
@@ -98,6 +103,7 @@ Feature: The export command
|
|
|
98
103
|
with two sentences.
|
|
99
104
|
--
|
|
100
105
|
ignored multiline.
|
|
106
|
+
|
|
101
107
|
Second line.
|
|
102
108
|
--
|
|
103
109
|
"""
|
|
@@ -106,7 +112,8 @@ Feature: The export command
|
|
|
106
112
|
"""
|
|
107
113
|
Type,Reference,Value,Checksum
|
|
108
114
|
requirement,TOTO-0001,"Exemple of multiline requirement.
|
|
109
|
-
|
|
115
|
+
|
|
116
|
+
Second line.",~78e36874
|
|
110
117
|
something_else,TOTO-0003,"only one paragraphe.
|
|
111
118
|
with two sentences.",~4761e172
|
|
112
119
|
"""
|
|
@@ -122,7 +129,9 @@ Feature: The export command
|
|
|
122
129
|
[define, requirement, TOTO-0001]
|
|
123
130
|
--
|
|
124
131
|
Exemple of multiline requirement.
|
|
132
|
+
|
|
125
133
|
Second line.
|
|
134
|
+
|
|
126
135
|
--
|
|
127
136
|
....
|
|
128
137
|
[define, something_else, TOTO-0003]
|
|
@@ -142,7 +151,9 @@ Feature: The export command
|
|
|
142
151
|
[define, requirement, TOTO-0001]
|
|
143
152
|
--
|
|
144
153
|
Exemple of multiline requirement.
|
|
154
|
+
|
|
145
155
|
Second line.
|
|
156
|
+
|
|
146
157
|
--
|
|
147
158
|
----
|
|
148
159
|
[define, something_else, TOTO-0003]
|
|
@@ -162,7 +173,9 @@ Feature: The export command
|
|
|
162
173
|
[define, requirement, TOTO-0001]
|
|
163
174
|
--
|
|
164
175
|
Exemple of multiline requirement.
|
|
176
|
+
|
|
165
177
|
Second line.
|
|
178
|
+
|
|
166
179
|
--
|
|
167
180
|
////
|
|
168
181
|
[define, something_else, TOTO-0003]
|
|
@@ -182,7 +195,9 @@ Feature: The export command
|
|
|
182
195
|
[define, requirement, TOTO-0001]
|
|
183
196
|
--
|
|
184
197
|
Exemple of multiline requirement.
|
|
198
|
+
|
|
185
199
|
Second line.
|
|
200
|
+
|
|
186
201
|
--
|
|
187
202
|
////
|
|
188
203
|
[define, whatever, TOTO-0003]
|
|
@@ -204,6 +219,7 @@ Feature: The export command
|
|
|
204
219
|
[define, requirement, TOTO-0001, A nice summary]
|
|
205
220
|
--
|
|
206
221
|
Exemple of multiline requirement.
|
|
222
|
+
|
|
207
223
|
Second line.
|
|
208
224
|
--
|
|
209
225
|
"""
|
|
@@ -212,7 +228,8 @@ Feature: The export command
|
|
|
212
228
|
"""
|
|
213
229
|
Type,Reference,Summary,Value,Checksum
|
|
214
230
|
requirement,TOTO-0001,A nice summary,"Exemple of multiline requirement.
|
|
215
|
-
|
|
231
|
+
|
|
232
|
+
Second line.",~98dc7abd
|
|
216
233
|
"""
|
|
217
234
|
And the stdout should not contain anything
|
|
218
235
|
|
|
@@ -223,6 +240,7 @@ Feature: The export command
|
|
|
223
240
|
[define, requirement, TOTO-0001, A nice {a_variable}]
|
|
224
241
|
--
|
|
225
242
|
Exemple of multiline requirement.
|
|
243
|
+
|
|
226
244
|
Second line.
|
|
227
245
|
--
|
|
228
246
|
"""
|
|
@@ -231,7 +249,8 @@ Feature: The export command
|
|
|
231
249
|
"""
|
|
232
250
|
Type,Reference,Summary,Value,Checksum
|
|
233
251
|
requirement,TOTO-0001,A nice summary,"Exemple of multiline requirement.
|
|
234
|
-
|
|
252
|
+
|
|
253
|
+
Second line.",~98dc7abd
|
|
235
254
|
"""
|
|
236
255
|
And the stdout should not contain anything
|
|
237
256
|
|
|
@@ -241,6 +260,7 @@ Feature: The export command
|
|
|
241
260
|
[define, requirement, TOTO-0001, " A nice, summary " ]
|
|
242
261
|
--
|
|
243
262
|
Exemple of multiline requirement.
|
|
263
|
+
|
|
244
264
|
Second line.
|
|
245
265
|
--
|
|
246
266
|
"""
|
|
@@ -249,7 +269,8 @@ Feature: The export command
|
|
|
249
269
|
"""
|
|
250
270
|
Type,Reference,Summary,Value,Checksum
|
|
251
271
|
requirement,TOTO-0001,"A nice, summary","Exemple of multiline requirement.
|
|
252
|
-
|
|
272
|
+
|
|
273
|
+
Second line.",~350d850e
|
|
253
274
|
"""
|
|
254
275
|
And the stdout should not contain anything
|
|
255
276
|
|
|
@@ -259,6 +280,7 @@ Feature: The export command
|
|
|
259
280
|
[define, requirement, TOTO-0001, [label1, label2]]
|
|
260
281
|
--
|
|
261
282
|
Exemple of multiline requirement.
|
|
283
|
+
|
|
262
284
|
Second line.
|
|
263
285
|
--
|
|
264
286
|
"""
|
|
@@ -267,7 +289,8 @@ Feature: The export command
|
|
|
267
289
|
"""
|
|
268
290
|
Type,Reference,Value,Checksum,Labels
|
|
269
291
|
requirement,TOTO-0001,"Exemple of multiline requirement.
|
|
270
|
-
|
|
292
|
+
|
|
293
|
+
Second line.",~78e36874,"label1
|
|
271
294
|
label2"
|
|
272
295
|
"""
|
|
273
296
|
And the stdout should not contain anything
|
|
@@ -280,6 +303,7 @@ Feature: The export command
|
|
|
280
303
|
[define, requirement, TOTO-0001]
|
|
281
304
|
--
|
|
282
305
|
Exemple of multiline requirement.
|
|
306
|
+
|
|
283
307
|
Second line.
|
|
284
308
|
--
|
|
285
309
|
defs:eref[implements, [SYSTEM-0012, SYSTEM-0014]]
|
|
@@ -289,7 +313,8 @@ Feature: The export command
|
|
|
289
313
|
"""
|
|
290
314
|
Type,Reference,Value,Checksum,Participate to:
|
|
291
315
|
requirement,TOTO-0001,"Exemple of multiline requirement.
|
|
292
|
-
|
|
316
|
+
|
|
317
|
+
Second line.",~78e36874,"SYSTEM-0012
|
|
293
318
|
SYSTEM-0014"
|
|
294
319
|
"""
|
|
295
320
|
And the stdout should not contain anything
|
|
@@ -302,6 +327,7 @@ Feature: The export command
|
|
|
302
327
|
[define, requirement, TOTO-0001]
|
|
303
328
|
--
|
|
304
329
|
Exemple of multiline requirement.
|
|
330
|
+
|
|
305
331
|
Second line.
|
|
306
332
|
--
|
|
307
333
|
defs:eref[implements, [SYSTEM-0012(a), SYSTEM-0014, SYSTEM-0015(b~1223abcd)]]
|
|
@@ -311,7 +337,8 @@ Feature: The export command
|
|
|
311
337
|
"""
|
|
312
338
|
Type,Reference,Value,Checksum,Participate to:
|
|
313
339
|
requirement,TOTO-0001,"Exemple of multiline requirement.
|
|
314
|
-
|
|
340
|
+
|
|
341
|
+
Second line.",~78e36874,"SYSTEM-0012(a)
|
|
315
342
|
SYSTEM-0014
|
|
316
343
|
SYSTEM-0015(b~1223abcd)"
|
|
317
344
|
"""
|
|
@@ -325,6 +352,7 @@ Feature: The export command
|
|
|
325
352
|
[define, requirement, TOTO-0001]
|
|
326
353
|
--
|
|
327
354
|
Exemple of multiline requirement.
|
|
355
|
+
|
|
328
356
|
Second line.
|
|
329
357
|
--
|
|
330
358
|
"""
|
|
@@ -333,7 +361,8 @@ Feature: The export command
|
|
|
333
361
|
"""
|
|
334
362
|
Type,Reference,Value,Checksum,Participate to:
|
|
335
363
|
requirement,TOTO-0001,"Exemple of multiline requirement.
|
|
336
|
-
|
|
364
|
+
|
|
365
|
+
Second line.",~78e36874,
|
|
337
366
|
"""
|
|
338
367
|
And the stdout should not contain anything
|
|
339
368
|
|
|
@@ -345,6 +374,7 @@ Feature: The export command
|
|
|
345
374
|
[define, requirement, TOTO-0001]
|
|
346
375
|
--
|
|
347
376
|
Exemple of multiline requirement.
|
|
377
|
+
|
|
348
378
|
Second line.
|
|
349
379
|
--
|
|
350
380
|
defs:eref[implements, [SYSTEM-0012, SYSTEM-0014]]
|
|
@@ -354,7 +384,8 @@ Feature: The export command
|
|
|
354
384
|
"""
|
|
355
385
|
Type,Reference,Value,Checksum,Participate to:
|
|
356
386
|
requirement,TOTO-0001,"Exemple of multiline requirement.
|
|
357
|
-
|
|
387
|
+
|
|
388
|
+
Second line.",~78e36874,"SYSTEM-0012
|
|
358
389
|
SYSTEM-0014"
|
|
359
390
|
"""
|
|
360
391
|
And the stdout should not contain anything
|
|
@@ -366,6 +397,7 @@ Feature: The export command
|
|
|
366
397
|
[define, requirement, TOTO-0001]
|
|
367
398
|
--
|
|
368
399
|
Exemple of multiline requirement.
|
|
400
|
+
|
|
369
401
|
Second line.
|
|
370
402
|
--
|
|
371
403
|
defs:eref[implements, [SYSTEM-0012, SYSTEM-0014]]
|
|
@@ -376,10 +408,12 @@ Feature: The export command
|
|
|
376
408
|
"""
|
|
377
409
|
Type,Reference,Value,Checksum,Participate to:
|
|
378
410
|
requirement,TOTO-0001,"Exemple of multiline requirement.
|
|
379
|
-
|
|
411
|
+
|
|
412
|
+
Second line.",~78e36874,"SYSTEM-0012
|
|
380
413
|
SYSTEM-0014"
|
|
381
414
|
"""
|
|
382
415
|
|
|
416
|
+
|
|
383
417
|
Scenario: Export one definition with internal ref to CSV
|
|
384
418
|
Given a file named "toto.adoc" with:
|
|
385
419
|
"""
|
|
@@ -535,6 +569,7 @@ Feature: The export command
|
|
|
535
569
|
[define, requirement, TOTO-0001]
|
|
536
570
|
--
|
|
537
571
|
Exemple of multiline requirement.
|
|
572
|
+
|
|
538
573
|
Second line.
|
|
539
574
|
--
|
|
540
575
|
"""
|
|
@@ -547,6 +582,7 @@ Feature: The export command
|
|
|
547
582
|
[define, requirement, TOTO-0001]
|
|
548
583
|
--
|
|
549
584
|
Exemple of multiline requirement.
|
|
585
|
+
|
|
550
586
|
Second line.
|
|
551
587
|
--
|
|
552
588
|
"""
|
|
@@ -557,8 +593,8 @@ Feature: The export command
|
|
|
557
593
|
{
|
|
558
594
|
"Type": "requirement",
|
|
559
595
|
"Reference": "TOTO-0001",
|
|
560
|
-
"Value": "Exemple of multiline requirement.\nSecond line.",
|
|
561
|
-
"Checksum": "~
|
|
596
|
+
"Value": "Exemple of multiline requirement.\n\nSecond line.",
|
|
597
|
+
"Checksum": "~78e36874"
|
|
562
598
|
}
|
|
563
599
|
]
|
|
564
600
|
"""
|
|
@@ -569,6 +605,7 @@ Feature: The export command
|
|
|
569
605
|
[define, requirement, TOTO-0001]
|
|
570
606
|
--
|
|
571
607
|
Exemple of multiline requirement.
|
|
608
|
+
|
|
572
609
|
Second line.
|
|
573
610
|
--
|
|
574
611
|
"""
|
|
@@ -580,6 +617,7 @@ Feature: The export command
|
|
|
580
617
|
:Reference: TOTO-0001
|
|
581
618
|
:Value: |-
|
|
582
619
|
Exemple of multiline requirement.
|
|
620
|
+
|
|
583
621
|
Second line.
|
|
584
|
-
:Checksum: "~
|
|
622
|
+
:Checksum: "~78e36874"
|
|
585
623
|
"""
|
|
@@ -20,3 +20,33 @@ Given('I set the {string} tag') do |tag_name|
|
|
|
20
20
|
git = Git.open(Aruba.config.home_directory)
|
|
21
21
|
git.add_tag(tag_name)
|
|
22
22
|
end
|
|
23
|
+
|
|
24
|
+
Given('I initialize a git repo in {string}') do |repo_dir|
|
|
25
|
+
require 'fileutils'
|
|
26
|
+
repo_path = File.join(Aruba.config.home_directory, repo_dir)
|
|
27
|
+
FileUtils.mkdir_p(repo_path)
|
|
28
|
+
|
|
29
|
+
git = Git.init(repo_path)
|
|
30
|
+
git.config('user.name', 'Bob Léponge')
|
|
31
|
+
git.config('user.email', 'bob.léponge@example.com')
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
Given('I add and commit the changes in repo {string}') do |repo_dir|
|
|
35
|
+
repo_path = File.join(Aruba.config.home_directory, repo_dir)
|
|
36
|
+
git = Git.open(repo_path)
|
|
37
|
+
|
|
38
|
+
git.config('user.name', 'Bob Léponge')
|
|
39
|
+
git.config('user.email', 'bob.léponge@example.com')
|
|
40
|
+
git.add(all: true)
|
|
41
|
+
git.commit('Commit changes')
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
Given('I add the repo {string} as a submodule {string}') do |remote_dir, submodule_dir|
|
|
45
|
+
run_command("git submodule add ./#{remote_dir} #{submodule_dir}")
|
|
46
|
+
last_command_started.wait
|
|
47
|
+
|
|
48
|
+
main_git = Git.open(Aruba.config.home_directory)
|
|
49
|
+
main_git.add('.gitmodules')
|
|
50
|
+
main_git.add(submodule_dir)
|
|
51
|
+
main_git.commit("Add submodule #{submodule_dir}")
|
|
52
|
+
end
|
data/features/support/env.rb
CHANGED
|
@@ -3,17 +3,18 @@
|
|
|
3
3
|
|
|
4
4
|
require('aruba/cucumber')
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
# "#{File::PATH_SEPARATOR}#{ENV['PATH']}"
|
|
8
|
-
# LIB_DIR = File.join(__dir__, '..', '..', 'lib')
|
|
6
|
+
require 'cucumber/formatter/message_builder'
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
#
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
#
|
|
19
|
-
|
|
8
|
+
module Cucumber
|
|
9
|
+
module Formatter
|
|
10
|
+
# Temporary fix for Cucumber 10.2.0 + Ruby 4.0.2 NoMethodError
|
|
11
|
+
class MessageBuilder
|
|
12
|
+
# Temporary fix for Cucumber 10.2.0 + Ruby 4.0.2 NoMethodError
|
|
13
|
+
def argument_group_to_message(argument_group)
|
|
14
|
+
# On s'assure que children n'est pas nil avant d'appeler map
|
|
15
|
+
argument_group.children || []
|
|
16
|
+
# ... (le reste de la logique originale avec le garde-fou)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -31,7 +31,7 @@ module Defmastership
|
|
|
31
31
|
new_config_content = config.merge_no_new(new_config).to_yaml.split("\n")
|
|
32
32
|
|
|
33
33
|
# Put in there place the emty lines and comments
|
|
34
|
-
File.
|
|
34
|
+
File.foreach(@filename, chomp: true).with_index do |line, line_num|
|
|
35
35
|
if /\A\s*(\#.*)?\z/.match?(line)
|
|
36
36
|
new_config_content.insert(line_num, line)
|
|
37
37
|
elsif line =~ /\A\s*[^\s].+?(\s*\#.*)\z/
|
|
@@ -49,8 +49,14 @@ module Defmastership
|
|
|
49
49
|
private
|
|
50
50
|
|
|
51
51
|
def parse_ref_files_from_git(adoc_sources, tmpdir)
|
|
52
|
-
|
|
52
|
+
repo_url = Helper.resolve_remote_url(ref_repo)
|
|
53
|
+
|
|
54
|
+
Git.clone(repo_url, tmpdir, branch: ref_tag, recursive: true)
|
|
53
55
|
ref_sources = ref_document.empty? ? adoc_sources.keys : ref_document
|
|
56
|
+
parse_tmpdir_files(tmpdir, ref_sources)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def parse_tmpdir_files(tmpdir, ref_sources)
|
|
54
60
|
ref_sources.each do |adoc_file|
|
|
55
61
|
@ref_document.parse_file_with_preprocessor("#{tmpdir}/#{adoc_file}")
|
|
56
62
|
end
|
|
@@ -78,6 +84,26 @@ module Defmastership
|
|
|
78
84
|
|
|
79
85
|
# Helper functions
|
|
80
86
|
module Helper
|
|
87
|
+
# @param path [String] the repository path
|
|
88
|
+
# @return [String, nil] the origin URL if found
|
|
89
|
+
def self.find_origin_url(path)
|
|
90
|
+
local_git = Git.open(path)
|
|
91
|
+
origin_remote = local_git.remotes.find { |remote| remote.name.eql?('origin') }
|
|
92
|
+
origin_remote&.url
|
|
93
|
+
rescue ArgumentError
|
|
94
|
+
nil
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# @param path [String] the repository path
|
|
98
|
+
# @return [String] the resolved remote URL
|
|
99
|
+
def self.resolve_remote_url(path)
|
|
100
|
+
if File.directory?(path)
|
|
101
|
+
find_origin_url(path) || path
|
|
102
|
+
else
|
|
103
|
+
path
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
81
107
|
# @param doc [Document] the document with defintions
|
|
82
108
|
# @param match [MatchData] Regexp match matching a reference
|
|
83
109
|
# @return [Definition] the definition from a +Document+ with a matching reference
|
|
@@ -62,8 +62,12 @@ RSpec.describe(Defmastership::ConfigPreserver) do
|
|
|
62
62
|
|
|
63
63
|
before do
|
|
64
64
|
allow(YAML).to(receive(:load_file).with('configuration.yml').and_return(original_config))
|
|
65
|
-
allow(File).to(
|
|
66
|
-
|
|
65
|
+
allow(File).to(
|
|
66
|
+
receive(:foreach).with(
|
|
67
|
+
'configuration.yml',
|
|
68
|
+
chomp: true
|
|
69
|
+
).and_return(original_file_content.each_line(chomp: true))
|
|
70
|
+
)
|
|
67
71
|
allow(File).to(receive(:write))
|
|
68
72
|
end
|
|
69
73
|
|
|
@@ -113,8 +117,12 @@ RSpec.describe(Defmastership::ConfigPreserver) do
|
|
|
113
117
|
|
|
114
118
|
before do
|
|
115
119
|
allow(YAML).to(receive(:load_file).with('configuration.yml').and_return(original_config))
|
|
116
|
-
allow(File).to(
|
|
117
|
-
|
|
120
|
+
allow(File).to(
|
|
121
|
+
receive(:foreach).with(
|
|
122
|
+
'configuration.yml',
|
|
123
|
+
chomp: true
|
|
124
|
+
).and_return(original_file_content.each_line(chomp: true))
|
|
125
|
+
)
|
|
118
126
|
allow(File).to(receive(:write))
|
|
119
127
|
end
|
|
120
128
|
|
|
@@ -131,6 +131,30 @@ RSpec.describe(Defmastership::Document) do
|
|
|
131
131
|
it { expect(definition).to(have_received(:<<).with('b')) }
|
|
132
132
|
end
|
|
133
133
|
|
|
134
|
+
context 'when complete definition with content including empty line' do
|
|
135
|
+
let(:input_lines) do
|
|
136
|
+
[
|
|
137
|
+
'[define, requirement, TOTO-0001]',
|
|
138
|
+
'--',
|
|
139
|
+
'a',
|
|
140
|
+
'',
|
|
141
|
+
'b',
|
|
142
|
+
'--',
|
|
143
|
+
'not included'
|
|
144
|
+
]
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
before do
|
|
148
|
+
allow(definition).to(receive(:<<).and_return(definition))
|
|
149
|
+
document.__send__(:do_parse, input_lines)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
it { expect(definition).to(have_received(:<<).with('a')) }
|
|
153
|
+
it { expect(definition).to(have_received(:<<).with('')) }
|
|
154
|
+
it { expect(definition).to(have_received(:<<).with('b')) }
|
|
155
|
+
it { expect(definition).not_to(have_received(:<<).with(true)) }
|
|
156
|
+
end
|
|
157
|
+
|
|
134
158
|
context 'when complete definition with content including ----' do
|
|
135
159
|
let(:input_lines) do
|
|
136
160
|
[
|
|
@@ -116,6 +116,7 @@ RSpec.describe(Defmastership::Modifier::UpdateDefVersion) do
|
|
|
116
116
|
before do
|
|
117
117
|
allow(Dir).to(receive(:mktmpdir).and_yield('tmp'))
|
|
118
118
|
allow(Git).to(receive(:clone))
|
|
119
|
+
allow(Git).to(receive(:open)).and_raise(ArgumentError)
|
|
119
120
|
allow(Defmastership::Document).to(receive(:new).twice.and_return(ref_document, document))
|
|
120
121
|
allow(document).to(receive(:parse_file_with_preprocessor).with('file1.adoc'))
|
|
121
122
|
allow(document).to(receive(:parse_file_with_preprocessor).with('file2.adoc'))
|
|
@@ -131,7 +132,7 @@ RSpec.describe(Defmastership::Modifier::UpdateDefVersion) do
|
|
|
131
132
|
end
|
|
132
133
|
|
|
133
134
|
it { expect(Dir).to(have_received(:mktmpdir).with('defmastership')) }
|
|
134
|
-
it { expect(Git).to(have_received(:clone).with('.', 'tmp', branch: 'THE_TAG')) }
|
|
135
|
+
it { expect(Git).to(have_received(:clone).with('.', 'tmp', branch: 'THE_TAG', recursive: true)) }
|
|
135
136
|
it { expect(Defmastership::Document).to(have_received(:new).twice) }
|
|
136
137
|
it { expect(ref_document).to(have_received(:parse_file_with_preprocessor).with('tmp/file1.adoc')) }
|
|
137
138
|
it { expect(ref_document).to(have_received(:parse_file_with_preprocessor).with('tmp/file2.adoc')) }
|
|
@@ -142,6 +143,111 @@ RSpec.describe(Defmastership::Modifier::UpdateDefVersion) do
|
|
|
142
143
|
end
|
|
143
144
|
end
|
|
144
145
|
|
|
146
|
+
context 'when ref_repo is not a directory' do
|
|
147
|
+
subject(:modifier) do
|
|
148
|
+
described_class.new(ref_tag: 'THE_TAG', ref_repo: 'not_a_directory', def_type: 'req', first_version: 'a')
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
let(:adoc_sources) do
|
|
152
|
+
{
|
|
153
|
+
'file1.adoc' => "[define,req,REFERENCE]\nfile1 line2"
|
|
154
|
+
}
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
before do
|
|
158
|
+
document = instance_double(Defmastership::Document, 'document')
|
|
159
|
+
ref_document = instance_double(Defmastership::Document, 'ref_document')
|
|
160
|
+
definition = instance_double(Defmastership::Definition, 'definition')
|
|
161
|
+
ref_definition = instance_double(Defmastership::Definition, 'ref_definitions')
|
|
162
|
+
|
|
163
|
+
allow(Dir).to(receive(:mktmpdir).and_yield('tmp'))
|
|
164
|
+
allow(Git).to(receive(:clone))
|
|
165
|
+
allow(File).to(receive(:directory?).with('not_a_directory').and_return(false))
|
|
166
|
+
|
|
167
|
+
allow(Defmastership::Document).to(receive(:new).twice.and_return(ref_document, document))
|
|
168
|
+
allow(document).to(receive_messages(parse_file_with_preprocessor: nil, ref_to_def: definition))
|
|
169
|
+
allow(ref_document).to(receive_messages(parse_file_with_preprocessor: nil, ref_to_def: ref_definition))
|
|
170
|
+
allow(ref_definition).to(receive_messages(explicit_version: nil, sha256_short: 'something_else'))
|
|
171
|
+
allow(definition).to(receive(:sha256_short).and_return('something'))
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
it 'clones the non-directory path directly as the repository URL' do
|
|
175
|
+
modifier.do_modifications(adoc_sources)
|
|
176
|
+
expect(Git).to(have_received(:clone).with('not_a_directory', 'tmp', branch: 'THE_TAG', recursive: true))
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
context 'when ref_repo is a local git repository' do
|
|
181
|
+
subject(:modifier) { described_class.new(ref_tag: 'THE_TAG', def_type: 'req', first_version: 'a') }
|
|
182
|
+
|
|
183
|
+
let(:local_git) { instance_double(Git::Base) }
|
|
184
|
+
let(:remote) { instance_double(Git::Remote, name: 'origin', url: 'https://gitlab.example.com/repo.git') }
|
|
185
|
+
let(:adoc_sources) do
|
|
186
|
+
{
|
|
187
|
+
'file1.adoc' => "[define,req,REFERENCE]\nfile1 line2"
|
|
188
|
+
}
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
before do
|
|
192
|
+
document = instance_double(Defmastership::Document, 'document')
|
|
193
|
+
ref_document = instance_double(Defmastership::Document, 'ref_document')
|
|
194
|
+
definition = instance_double(Defmastership::Definition, 'definition')
|
|
195
|
+
ref_definition = instance_double(Defmastership::Definition, 'ref_definitions')
|
|
196
|
+
|
|
197
|
+
allow(Dir).to(receive(:mktmpdir).and_yield('tmp'))
|
|
198
|
+
allow(Git).to(receive(:clone))
|
|
199
|
+
allow(File).to(receive(:directory?).with('.').and_return(true))
|
|
200
|
+
allow(Git).to(receive(:open)).with('.').and_return(local_git)
|
|
201
|
+
allow(local_git).to(receive(:remotes)).and_return([remote])
|
|
202
|
+
|
|
203
|
+
allow(Defmastership::Document).to(receive(:new).twice.and_return(ref_document, document))
|
|
204
|
+
allow(document).to(receive_messages(parse_file_with_preprocessor: nil, ref_to_def: definition))
|
|
205
|
+
allow(ref_document).to(receive_messages(parse_file_with_preprocessor: nil, ref_to_def: ref_definition))
|
|
206
|
+
allow(ref_definition).to(receive_messages(explicit_version: nil, sha256_short: 'something_else'))
|
|
207
|
+
allow(definition).to(receive(:sha256_short).and_return('something'))
|
|
208
|
+
|
|
209
|
+
modifier.do_modifications(adoc_sources)
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
it { expect(Git).to(have_received(:clone).with('https://gitlab.example.com/repo.git', 'tmp', branch: 'THE_TAG', recursive: true)) }
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
context 'when ref_repo is a local git repository without an origin remote' do
|
|
216
|
+
subject(:modifier) { described_class.new(ref_tag: 'THE_TAG', def_type: 'req', first_version: 'a') }
|
|
217
|
+
|
|
218
|
+
let(:local_git) { instance_double(Git::Base) }
|
|
219
|
+
let(:remote) { instance_double(Git::Remote, name: 'upstream', url: 'https://gitlab.example.com/repo.git') }
|
|
220
|
+
let(:adoc_sources) do
|
|
221
|
+
{
|
|
222
|
+
'file1.adoc' => "[define,req,REFERENCE]\nfile1 line2"
|
|
223
|
+
}
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
before do
|
|
227
|
+
document = instance_double(Defmastership::Document, 'document')
|
|
228
|
+
ref_document = instance_double(Defmastership::Document, 'ref_document')
|
|
229
|
+
definition = instance_double(Defmastership::Definition, 'definition')
|
|
230
|
+
ref_definition = instance_double(Defmastership::Definition, 'ref_definitions')
|
|
231
|
+
|
|
232
|
+
allow(Dir).to(receive(:mktmpdir).and_yield('tmp'))
|
|
233
|
+
allow(Git).to(receive(:clone))
|
|
234
|
+
allow(File).to(receive(:directory?).with('.').and_return(true))
|
|
235
|
+
allow(Git).to(receive(:open)).with('.').and_return(local_git)
|
|
236
|
+
# Setup the mock so it doesn't find 'origin'
|
|
237
|
+
allow(local_git).to(receive(:remotes)).and_return([remote])
|
|
238
|
+
|
|
239
|
+
allow(Defmastership::Document).to(receive(:new).twice.and_return(ref_document, document))
|
|
240
|
+
allow(document).to(receive_messages(parse_file_with_preprocessor: nil, ref_to_def: definition))
|
|
241
|
+
allow(ref_document).to(receive_messages(parse_file_with_preprocessor: nil, ref_to_def: ref_definition))
|
|
242
|
+
allow(ref_definition).to(receive_messages(explicit_version: nil, sha256_short: 'something_else'))
|
|
243
|
+
allow(definition).to(receive(:sha256_short).and_return('something'))
|
|
244
|
+
|
|
245
|
+
modifier.do_modifications(adoc_sources)
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
it { expect(Git).to(have_received(:clone).with('.', 'tmp', branch: 'THE_TAG', recursive: true)) }
|
|
249
|
+
end
|
|
250
|
+
|
|
145
251
|
context 'when ref_tag and ref_repo is provided' do
|
|
146
252
|
subject(:modifier) do
|
|
147
253
|
described_class.new(ref_tag: 'THE_TAG', ref_repo: 'not dot', def_type: 'req', first_version: 'a')
|
|
@@ -161,6 +267,7 @@ RSpec.describe(Defmastership::Modifier::UpdateDefVersion) do
|
|
|
161
267
|
before do
|
|
162
268
|
allow(Dir).to(receive(:mktmpdir).and_yield('tmp'))
|
|
163
269
|
allow(Git).to(receive(:clone))
|
|
270
|
+
allow(Git).to(receive(:open)).and_raise(ArgumentError)
|
|
164
271
|
allow(Defmastership::Document).to(receive(:new).twice.and_return(ref_document, document))
|
|
165
272
|
allow(document).to(receive(:parse_file_with_preprocessor).with('file1.adoc'))
|
|
166
273
|
allow(document).to(receive(:parse_file_with_preprocessor).with('file2.adoc'))
|
|
@@ -176,7 +283,7 @@ RSpec.describe(Defmastership::Modifier::UpdateDefVersion) do
|
|
|
176
283
|
end
|
|
177
284
|
|
|
178
285
|
it { expect(Dir).to(have_received(:mktmpdir).with('defmastership')) }
|
|
179
|
-
it { expect(Git).to(have_received(:clone).with('not dot', 'tmp', branch: 'THE_TAG')) }
|
|
286
|
+
it { expect(Git).to(have_received(:clone).with('not dot', 'tmp', branch: 'THE_TAG', recursive: true)) }
|
|
180
287
|
it { expect(Defmastership::Document).to(have_received(:new).twice) }
|
|
181
288
|
it { expect(ref_document).to(have_received(:parse_file_with_preprocessor).with('tmp/file1.adoc')) }
|
|
182
289
|
it { expect(ref_document).to(have_received(:parse_file_with_preprocessor).with('tmp/file2.adoc')) }
|
|
@@ -211,6 +318,7 @@ RSpec.describe(Defmastership::Modifier::UpdateDefVersion) do
|
|
|
211
318
|
before do
|
|
212
319
|
allow(Dir).to(receive(:mktmpdir).and_yield('tmp'))
|
|
213
320
|
allow(Git).to(receive(:clone))
|
|
321
|
+
allow(Git).to(receive(:open)).and_raise(ArgumentError)
|
|
214
322
|
allow(Defmastership::Document).to(receive(:new).twice.and_return(ref_document, document))
|
|
215
323
|
allow(document).to(receive(:parse_file_with_preprocessor).with('file1.adoc'))
|
|
216
324
|
allow(document).to(receive(:parse_file_with_preprocessor).with('file2.adoc'))
|
|
@@ -225,7 +333,7 @@ RSpec.describe(Defmastership::Modifier::UpdateDefVersion) do
|
|
|
225
333
|
end
|
|
226
334
|
|
|
227
335
|
it { expect(Dir).to(have_received(:mktmpdir).with('defmastership')) }
|
|
228
|
-
it { expect(Git).to(have_received(:clone).with('.', 'tmp', branch: 'THE_TAG')) }
|
|
336
|
+
it { expect(Git).to(have_received(:clone).with('.', 'tmp', branch: 'THE_TAG', recursive: true)) }
|
|
229
337
|
it { expect(Defmastership::Document).to(have_received(:new).twice) }
|
|
230
338
|
it { expect(ref_document).to(have_received(:parse_file_with_preprocessor).with('tmp/./another/doc.adoc')) }
|
|
231
339
|
it { expect(ref_document).to(have_received(:parse_file_with_preprocessor).once) }
|
|
@@ -236,6 +344,77 @@ RSpec.describe(Defmastership::Modifier::UpdateDefVersion) do
|
|
|
236
344
|
end
|
|
237
345
|
end
|
|
238
346
|
|
|
347
|
+
describe '.resolve_remote_url' do
|
|
348
|
+
subject(:resolved_url) { described_class.const_get(:Helper).resolve_remote_url(path) }
|
|
349
|
+
|
|
350
|
+
context 'when the path is not a directory' do
|
|
351
|
+
let(:path) { 'git@github.com:org/repo.git' }
|
|
352
|
+
|
|
353
|
+
before do
|
|
354
|
+
allow(File).to(receive(:directory?).with(path).and_return(false))
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
it 'returns the exact path itself' do
|
|
358
|
+
expect(resolved_url).to(be(path))
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
it 'queries File.directory?' do
|
|
362
|
+
resolved_url
|
|
363
|
+
expect(File).to(have_received(:directory?).with(path))
|
|
364
|
+
end
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
context 'when the path is a directory and has an origin remote' do
|
|
368
|
+
let(:path) { '/path/to/local/repo' }
|
|
369
|
+
let(:local_git) { instance_double(Git::Base) }
|
|
370
|
+
let(:remote) { instance_double(Git::Remote, name: 'origin', url: 'https://gitlab.example.com/repo.git') }
|
|
371
|
+
|
|
372
|
+
before do
|
|
373
|
+
allow(File).to(receive(:directory?).with(path).and_return(true))
|
|
374
|
+
allow(Git).to(receive(:open)).with(path).and_return(local_git)
|
|
375
|
+
allow(local_git).to(receive(:remotes)).and_return([remote])
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
it 'returns the origin remote url' do
|
|
379
|
+
expect(resolved_url).to(eq('https://gitlab.example.com/repo.git'))
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
it 'queries File.directory?' do
|
|
383
|
+
resolved_url
|
|
384
|
+
expect(File).to(have_received(:directory?).with(path))
|
|
385
|
+
end
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
context 'when the path is a directory but does not have an origin remote' do
|
|
389
|
+
let(:path) { '/path/to/local/repo' }
|
|
390
|
+
let(:local_git) { instance_double(Git::Base) }
|
|
391
|
+
let(:remote) { instance_double(Git::Remote, name: 'upstream', url: 'https://gitlab.example.com/repo.git') }
|
|
392
|
+
|
|
393
|
+
before do
|
|
394
|
+
allow(File).to(receive(:directory?).with(path).and_return(true))
|
|
395
|
+
allow(Git).to(receive(:open)).with(path).and_return(local_git)
|
|
396
|
+
allow(local_git).to(receive(:remotes)).and_return([remote])
|
|
397
|
+
end
|
|
398
|
+
|
|
399
|
+
it 'returns the path itself' do
|
|
400
|
+
expect(resolved_url).to(eq(path))
|
|
401
|
+
end
|
|
402
|
+
end
|
|
403
|
+
|
|
404
|
+
context 'when Git.open raises an ArgumentError' do
|
|
405
|
+
let(:path) { '/path/to/local/repo' }
|
|
406
|
+
|
|
407
|
+
before do
|
|
408
|
+
allow(File).to(receive(:directory?).with(path).and_return(true))
|
|
409
|
+
allow(Git).to(receive(:open)).with(path).and_raise(ArgumentError)
|
|
410
|
+
end
|
|
411
|
+
|
|
412
|
+
it 'returns the path itself' do
|
|
413
|
+
expect(resolved_url).to(eq(path))
|
|
414
|
+
end
|
|
415
|
+
end
|
|
416
|
+
end
|
|
417
|
+
|
|
239
418
|
describe '#replace_reference' do
|
|
240
419
|
subject(:modifier) { described_class.new(def_type: 'requirement', first_version: 'a') }
|
|
241
420
|
|
|
@@ -29,23 +29,26 @@ RSpec.describe(Defmastership::Modifier::UpdateIrefChecksum) do
|
|
|
29
29
|
allow(Defmastership::Document).to(receive(:new).and_return(document))
|
|
30
30
|
allow(document).to(receive(:parse_file_with_preprocessor))
|
|
31
31
|
allow_any_instance_of(Defmastership::Modifier::ModifierCommon).to(receive(:do_modifications).and_return(adoc_sources))
|
|
32
|
+
end
|
|
32
33
|
|
|
34
|
+
it 'creates a new document' do
|
|
33
35
|
modifier.do_modifications(adoc_sources)
|
|
36
|
+
expect(Defmastership::Document).to(have_received(:new))
|
|
34
37
|
end
|
|
35
38
|
|
|
36
|
-
it
|
|
39
|
+
it 'parses the first adoc file with preprocessor' do
|
|
40
|
+
modifier.do_modifications(adoc_sources)
|
|
41
|
+
expect(document).to(have_received(:parse_file_with_preprocessor).with('file1.adoc'))
|
|
42
|
+
end
|
|
37
43
|
|
|
38
|
-
it do
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
.once.with('file1.adoc')
|
|
42
|
-
.once.with('file2.adoc')
|
|
43
|
-
)
|
|
44
|
+
it 'parses the second adoc file with preprocessor' do
|
|
45
|
+
modifier.do_modifications(adoc_sources)
|
|
46
|
+
expect(document).to(have_received(:parse_file_with_preprocessor).with('file2.adoc'))
|
|
44
47
|
end
|
|
45
48
|
|
|
46
49
|
it { expect(modifier.do_modifications(adoc_sources)).to(eq(adoc_sources)) }
|
|
47
50
|
|
|
48
|
-
it 'call the parent method' do
|
|
51
|
+
it 'call the parent method with arguments' do
|
|
49
52
|
expect_any_instance_of(Defmastership::Modifier::ModifierCommon).to(receive(:do_modifications).with(adoc_sources))
|
|
50
53
|
modifier.do_modifications(adoc_sources)
|
|
51
54
|
end
|
|
@@ -29,23 +29,26 @@ RSpec.describe(Defmastership::Modifier::UpdateIrefVersion) do
|
|
|
29
29
|
allow(Defmastership::Document).to(receive(:new).and_return(document))
|
|
30
30
|
allow(document).to(receive(:parse_file_with_preprocessor))
|
|
31
31
|
allow_any_instance_of(Defmastership::Modifier::ModifierCommon).to(receive(:do_modifications).and_return(adoc_sources))
|
|
32
|
+
end
|
|
32
33
|
|
|
34
|
+
it 'creates a new document' do
|
|
33
35
|
modifier.do_modifications(adoc_sources)
|
|
36
|
+
expect(Defmastership::Document).to(have_received(:new))
|
|
34
37
|
end
|
|
35
38
|
|
|
36
|
-
it
|
|
39
|
+
it 'parses the first adoc file with preprocessor' do
|
|
40
|
+
modifier.do_modifications(adoc_sources)
|
|
41
|
+
expect(document).to(have_received(:parse_file_with_preprocessor).with('file1.adoc'))
|
|
42
|
+
end
|
|
37
43
|
|
|
38
|
-
it do
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
.once.with('file1.adoc')
|
|
42
|
-
.once.with('file2.adoc')
|
|
43
|
-
)
|
|
44
|
+
it 'parses the second adoc file with preprocessor' do
|
|
45
|
+
modifier.do_modifications(adoc_sources)
|
|
46
|
+
expect(document).to(have_received(:parse_file_with_preprocessor).with('file2.adoc'))
|
|
44
47
|
end
|
|
45
48
|
|
|
46
49
|
it { expect(modifier.do_modifications(adoc_sources)).to(eq(adoc_sources)) }
|
|
47
50
|
|
|
48
|
-
it 'call the parent method' do
|
|
51
|
+
it 'call the parent method with arguments' do
|
|
49
52
|
expect_any_instance_of(Defmastership::Modifier::ModifierCommon).to(receive(:do_modifications).with(adoc_sources))
|
|
50
53
|
modifier.do_modifications(adoc_sources)
|
|
51
54
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: defmastership
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jérôme Arbez-Gindre
|
|
@@ -272,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
272
272
|
- !ruby/object:Gem::Version
|
|
273
273
|
version: '0'
|
|
274
274
|
requirements: []
|
|
275
|
-
rubygems_version: 4.0.
|
|
275
|
+
rubygems_version: 4.0.12
|
|
276
276
|
specification_version: 4
|
|
277
277
|
summary: Handling of references and definitions with asciidoctor
|
|
278
278
|
test_files: []
|