defmastership 1.3.5 → 1.3.6
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/export.feature +53 -15
- 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/version.rb +1 -1
- data/spec/unit/defmastership/config_preserver_spec.rb +12 -4
- data/spec/unit/defmastership/document_spec.rb +24 -0
- 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: b282623e3f26fd7e1b8f88df3605ffb8a536c5d7a71e3f8f6b41d937d740c77c
|
|
4
|
+
data.tar.gz: af43d982dc66141dced00cf731300759631b5730fda62b250c43bde1d026d844
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dbcdd3fc1b665dd867760123c43927f6f27b83726000a8e567f20fc716269ae073ca4c70f3362c029ff4347d6f0371068b6e15ab893e74fef89cf6419cbd9487
|
|
7
|
+
data.tar.gz: 67e21c19f23d236f53bda017cfd5fdf1ce7700490b8e68c805c042f3f902123c7d1f275b06046a2c3ecc6614e5bf527dc3db0d5fb6addbc24c0a002337ae06bd
|
data/Gemfile
CHANGED
data/config/rubocop.yml
CHANGED
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
|
"""
|
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/
|
|
@@ -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
|
[
|
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.6
|
|
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.9
|
|
276
276
|
specification_version: 4
|
|
277
277
|
summary: Handling of references and definitions with asciidoctor
|
|
278
278
|
test_files: []
|