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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a331a25b15fb26d3d242bc037b8c084de0edacd13fac0a6bacb9b9a7e078dd1b
4
- data.tar.gz: f166d30d3272ec3709c754978e1078bd4f67492dd697eb188e35c92317893578
3
+ metadata.gz: b282623e3f26fd7e1b8f88df3605ffb8a536c5d7a71e3f8f6b41d937d740c77c
4
+ data.tar.gz: af43d982dc66141dced00cf731300759631b5730fda62b250c43bde1d026d844
5
5
  SHA512:
6
- metadata.gz: beab382363108e87a92a566f8b84bc291053cd58161debbe35606abdf98eae2e3c1d1ab5e979d7f646f841219f6ea3ff8c3c7a4a288c02aea62641d7d439aaff
7
- data.tar.gz: 5cad56201f0bc16c7b51d70466ae519090dad20d79401cb67ff017f6c0cb8e8d4bdb6000fcfcb21b2036e8877b7de77afbc785fcf684575b9b3e09a63cb27b89
6
+ metadata.gz: dbcdd3fc1b665dd867760123c43927f6f27b83726000a8e567f20fc716269ae073ca4c70f3362c029ff4347d6f0371068b6e15ab893e74fef89cf6419cbd9487
7
+ data.tar.gz: 67e21c19f23d236f53bda017cfd5fdf1ce7700490b8e68c805c042f3f902123c7d1f275b06046a2c3ecc6614e5bf527dc3db0d5fb6addbc24c0a002337ae06bd
data/Gemfile CHANGED
@@ -11,7 +11,7 @@ group :development do
11
11
  # cucumber steps for command line tests
12
12
  gem 'aruba', '~> 2.3'
13
13
  # bdd
14
- gem 'cucumber', '10.1'
14
+ gem 'cucumber', '~> 10.2'
15
15
  # code duplication
16
16
  gem 'flay', '~> 2.14'
17
17
  # automatic test run
data/config/rubocop.yml CHANGED
@@ -33,6 +33,10 @@ Lint/ConstantResolution:
33
33
  Style/DocumentationMethod:
34
34
  Enabled: true
35
35
 
36
+ Style/OneClassPerFile:
37
+ Enabled: true
38
+ AllowedClasses: ['DummyClass']
39
+
36
40
  Style/StringHashKeys :
37
41
  Enabled: true
38
42
  Exclude:
@@ -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
- Second line.",~b86dcbde
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
- Second line.";~b86dcbde
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
- Second line.",~b86dcbde
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
- Second line.",~f8092f4e
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
- Second line.",~f8092f4e
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
- Second line.",~77a203d4
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
- Second line.",~b86dcbde,"label1
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
- Second line.",~b86dcbde,"SYSTEM-0012
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
- Second line.",~b86dcbde,"SYSTEM-0012(a)
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
- Second line.",~b86dcbde,
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
- Second line.",~b86dcbde,"SYSTEM-0012
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
- Second line.",~b86dcbde,"SYSTEM-0012
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": "~b86dcbde"
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: "~b86dcbde"
622
+ :Checksum: "~78e36874"
585
623
  """
@@ -3,17 +3,18 @@
3
3
 
4
4
  require('aruba/cucumber')
5
5
 
6
- # ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}"\
7
- # "#{File::PATH_SEPARATOR}#{ENV['PATH']}"
8
- # LIB_DIR = File.join(__dir__, '..', '..', 'lib')
6
+ require 'cucumber/formatter/message_builder'
9
7
 
10
- # Before do
11
- # # Using "announce" causes massive warnings on 1.9.2
12
- # @puts = true
13
- # @original_rubylib = ENV['RUBYLIB']
14
- # ENV['RUBYLIB'] = LIB_DIR + File::PATH_SEPARATOR + ENV['RUBYLIB'].to_s
15
- # end
16
-
17
- # After do
18
- # ENV['RUBYLIB'] = @original_rubylib
19
- # end
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.open(@filename, 'r').each_line(chomp: true).with_index do |line, line_num|
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/
@@ -166,6 +166,7 @@ module Defmastership
166
166
  public_send(event, matching_line)
167
167
  else
168
168
  @definition_parser.public_send(event, matching_line)
169
+ ''
169
170
  end
170
171
  end
171
172
 
@@ -64,7 +64,7 @@ module Defmastership
64
64
 
65
65
  def apply_to_one(filename, text, method)
66
66
  text.lines.map { |line| public_send(method, filename, line) }
67
- .join
67
+ .join
68
68
  end
69
69
  end
70
70
  end
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Defmastership
5
5
  # [String] Gem version
6
- VERSION = '1.3.5'
6
+ VERSION = '1.3.6'
7
7
  public_constant :VERSION
8
8
  end
@@ -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(receive(:open).with('configuration.yml', 'r').and_return(file))
66
- allow(file).to(receive(:each_line).with(chomp: true).and_return(original_file_content.each_line(chomp: true)))
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(receive(:open).with('configuration.yml', 'r').and_return(file))
117
- allow(file).to(receive(:each_line).with(chomp: true).and_return(original_file_content.each_line(chomp: true)))
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.5
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.5
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: []