defmastership 1.3.2 → 1.3.4

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.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +9 -9
  3. data/Guardfile +2 -5
  4. data/Rakefile +1 -1
  5. data/config/mutant.yml +2 -1
  6. data/config/rubocop.yml +20 -8
  7. data/defmastership.gemspec +6 -15
  8. data/features/changeref.feature +108 -0
  9. data/features/definition_checksum.feature +118 -0
  10. data/features/definition_version.feature +168 -0
  11. data/features/export.feature +122 -22
  12. data/features/external_ref_checksum.feature +169 -0
  13. data/features/external_ref_version.feature +173 -0
  14. data/features/internal_ref_checksum.feature +77 -0
  15. data/features/internal_ref_version.feature +81 -0
  16. data/features/rename_included_files.feature +55 -0
  17. data/features/step_definitions/git_steps.rb +3 -0
  18. data/lib/defmastership/app.rb +35 -8
  19. data/lib/defmastership/comment_filter.rb +2 -0
  20. data/lib/defmastership/def_type_list.rb +25 -0
  21. data/lib/defmastership/definition_parser.rb +2 -6
  22. data/lib/defmastership/document.rb +6 -9
  23. data/lib/defmastership/export/csv/formatter.rb +8 -60
  24. data/lib/defmastership/export/formatter.rb +88 -0
  25. data/lib/defmastership/export/json/formatter.rb +34 -0
  26. data/lib/defmastership/export/xlsx/formatter.rb +87 -0
  27. data/lib/defmastership/export/yaml/formatter.rb +34 -0
  28. data/lib/defmastership/modifier/change_ref.rb +24 -39
  29. data/lib/defmastership/modifier/factory.rb +5 -1
  30. data/lib/defmastership/modifier/modifier_common.rb +4 -4
  31. data/lib/defmastership/modifier/rename_included_files.rb +16 -5
  32. data/lib/defmastership/modifier/replacement_formatter.rb +37 -0
  33. data/lib/defmastership/modifier/update_def.rb +7 -2
  34. data/lib/defmastership/modifier/update_eref_checksum.rb +46 -0
  35. data/lib/defmastership/modifier/update_eref_common.rb +78 -0
  36. data/lib/defmastership/modifier/update_eref_version.rb +46 -0
  37. data/lib/defmastership/modifier/update_iref_checksum.rb +52 -0
  38. data/lib/defmastership/modifier/update_iref_common.rb +45 -0
  39. data/lib/defmastership/modifier/update_iref_version.rb +59 -0
  40. data/lib/defmastership/version.rb +1 -1
  41. data/spec/spec_helper.rb +11 -10
  42. data/spec/unit/defmastership/app_spec.rb +57 -20
  43. data/spec/unit/defmastership/batch_modifier_spec.rb +9 -7
  44. data/spec/unit/defmastership/def_type_list_spec.rb +22 -0
  45. data/spec/unit/defmastership/definition_spec.rb +8 -51
  46. data/spec/unit/defmastership/document_spec.rb +12 -36
  47. data/spec/unit/defmastership/export/body_formatter_spec.rb +5 -18
  48. data/spec/unit/defmastership/export/csv/formatter_spec.rb +45 -231
  49. data/spec/unit/defmastership/export/formatter_spec.rb +97 -0
  50. data/spec/unit/defmastership/export/header_formatter_spec.rb +2 -6
  51. data/spec/unit/defmastership/export/json/formatter_spec.rb +85 -0
  52. data/spec/unit/defmastership/export/xlsx/formatter_spec.rb +82 -0
  53. data/spec/unit/defmastership/export/yaml/formatter_spec.rb +85 -0
  54. data/spec/unit/defmastership/hash_spec.rb +2 -0
  55. data/spec/unit/defmastership/modifier/change_ref_spec.rb +66 -97
  56. data/spec/unit/defmastership/modifier/factory_spec.rb +40 -17
  57. data/spec/unit/defmastership/modifier/modifier_common_spec.rb +7 -5
  58. data/spec/unit/defmastership/modifier/rename_included_files_spec.rb +105 -85
  59. data/spec/unit/defmastership/modifier/update_def_checksum_spec.rb +6 -13
  60. data/spec/unit/defmastership/modifier/update_def_spec.rb +79 -22
  61. data/spec/unit/defmastership/modifier/update_def_version_spec.rb +13 -37
  62. data/spec/unit/defmastership/modifier/update_eref_checksum_spec.rb +209 -0
  63. data/spec/unit/defmastership/modifier/update_eref_version_spec.rb +227 -0
  64. data/spec/unit/defmastership/modifier/update_iref_checksum_spec.rb +133 -0
  65. data/spec/unit/defmastership/modifier/update_iref_version_spec.rb +162 -0
  66. data/tasks/code_quality.rake +1 -8
  67. data/tasks/test.rake +15 -0
  68. metadata +59 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 48dcfc9355927a24217b26f811929da3faa225f85429ad6c09502acb1a8d9330
4
- data.tar.gz: b18de20de3320444e7a30b2d93a63194672c8ae3d5abc6eab25d39877151234d
3
+ metadata.gz: 7005c6bf64a1de44a7ac2f511070d4233ec8abde7816df47ceb1219c77500732
4
+ data.tar.gz: 219352e005a6e87d02258caacc30ad537e3d644da8dc008b1d4b958e70f33fcc
5
5
  SHA512:
6
- metadata.gz: 8d9432830f28f130973894adc2e7a973568338e6d418ea808257ef3bdac58dd81ae5ed2c6195db9a6045132d6ac0bceefd35329b7d5f52733d85b2bb0205b2d2
7
- data.tar.gz: ffdcbfffb2a16e5eb79432da1ce89b4d6264866336b3b20196d03432f6026e283db369cf9f99e71abdb885cfbf1747fcd0db74586bd5aab38c667b25d46e954e
6
+ metadata.gz: 5a80ed40ddcf6300da7287b30e5e5c10bb4789aca80ef2c927a85056987c6831022e18e2459ac72633b408f05d3ab564292d96611c282f19e73d173534eadf91
7
+ data.tar.gz: 218bad889104732f8ba69f00b0313b7a8327ddffb7ea5bfd2e2fac66b4dd38ae37efacf7f0033be576b32924bececafa4582c02a7cf458bc9c81ed2474cbacbd
data/Gemfile CHANGED
@@ -11,13 +11,13 @@ group :development do
11
11
  # cucumber steps for command line tests
12
12
  gem 'aruba', '~> 2.3'
13
13
  # bdd
14
- gem 'cucumber', '~> 10.0'
14
+ gem 'cucumber', '~> 10.2'
15
15
  # code duplication
16
- gem 'flay', '~> 2.13'
16
+ gem 'flay', '~> 2.14'
17
17
  # automatic test run
18
18
  gem 'guard', '~> 2.19'
19
19
  # automatic update invocation
20
- gem 'guard-bundler', '~> 3.0'
20
+ # gem 'guard-bundler', '~> 3.0'
21
21
  # automatic style check
22
22
  gem 'guard-reek', '~> 1.2'
23
23
  # automatic tdd
@@ -31,21 +31,21 @@ group :development do
31
31
  # detect selling code
32
32
  gem 'reek', '~> 6.5'
33
33
  # needed by yard to render documentation
34
- gem 'rdoc', '~> 6.14'
34
+ gem 'rdoc', '~> 7.0'
35
35
  # tdd
36
36
  gem 'rspec', '~> 3.13'
37
37
  # code needs to be clean
38
- gem 'rubocop', '~> 1.77'
38
+ gem 'rubocop', '~> 1.82'
39
39
  # code needs to be clean
40
- gem 'rubocop-performance', '~> 1.25'
40
+ gem 'rubocop-performance', '~> 1.26'
41
41
  # test code needs to be clean
42
- gem 'rubocop-rspec', '~> 3.6'
42
+ gem 'rubocop-rspec', '~> 3.8'
43
43
  # Rakefiles need to be clean
44
44
  gem 'rubocop-rake', '~> 0.7'
45
45
  # Doc need to be clean
46
- gem 'rubocop-yard', '~> 0.10'
46
+ gem 'rubocop-yard', '~> 1.0'
47
47
  # my code needs to be critiqued
48
- gem 'rubycritic', '~> 4.9'
48
+ gem 'rubycritic', '~> 4.11'
49
49
  # What is tdd without code coverage ?
50
50
  gem 'simplecov', '~> 0.22'
51
51
  # to document code
data/Guardfile CHANGED
@@ -30,15 +30,12 @@ guard :rspec, cmd: 'bundle exec rspec --options config/rspec' do
30
30
  dsl.watch_spec_files_for(ruby.lib_files)
31
31
  end
32
32
 
33
- guard :rubocop,
34
- all_on_start: true,
35
- cli: ['--display-cop-names', '--config=config/rubocop.yml'] do
33
+ guard :rubocop, all_on_start: true, cli: ['--display-cop-names', '--config=config/rubocop.yml'] do
36
34
  watch(/.+\.rb$/)
37
35
  watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m.first) }
38
36
  end
39
37
 
40
- guard :reek,
41
- cli: ['--config config/reek.yml', '--single-line'] do
38
+ guard :reek, cli: ['--config config/reek.yml', '--single-line'] do
42
39
  watch(/.+\.rb$/)
43
40
  watch('config/reek.yml')
44
41
  end
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ task :ci do
10
10
  [
11
11
  'test:spec',
12
12
  'test:features',
13
- :rubocop
13
+ 'quality:all'
14
14
  ].each do |name|
15
15
  puts "\n=== Running #{name}...\n"
16
16
  Rake::Task[name].invoke
data/config/mutant.yml CHANGED
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  usage: opensource
3
- # fail_fast: true
4
3
  includes:
5
4
  - lib
6
5
  integration:
@@ -8,6 +7,8 @@ integration:
8
7
  arguments:
9
8
  - --options=config/rspec
10
9
  - spec
10
+ environment_variables:
11
+ CODE_COVERAGE_IN_RSPEC: disabled
11
12
  requires:
12
13
  - defmastership/batch_modifier
13
14
  - defmastership/comment_filter
data/config/rubocop.yml CHANGED
@@ -27,21 +27,25 @@ Style/Copyright:
27
27
  Notice: 'Copyright (\(c\) )?202[0-9] Jerome Arbez-Gindre'
28
28
  AutocorrectNotice: '# Copyright (c) 2023 Jerome Arbez-Gindre'
29
29
 
30
- Lint/ConstantResolution: # Not available ins rubocop 0.81
30
+ Lint/ConstantResolution:
31
31
  Enabled: false
32
32
 
33
33
  Style/DocumentationMethod:
34
- Enabled: false
34
+ Enabled: true
35
35
 
36
36
  Style/StringHashKeys :
37
37
  Enabled: true
38
38
  Exclude:
39
39
  - '*.gemspec'
40
- - 'spec/unit/defmastership/app_spec.rb'
41
- - 'spec/unit/defmastership/batch_modifier_spec.rb'
42
- - 'spec/unit/defmastership/modifier/update_def_checksum_spec.rb'
43
- - 'spec/unit/defmastership/modifier/update_def_spec.rb'
44
- - 'spec/unit/defmastership/modifier/update_def_version_spec.rb'
40
+ - spec/unit/defmastership/app_spec.rb
41
+ - spec/unit/defmastership/batch_modifier_spec.rb
42
+ - spec/unit/defmastership/modifier/update_def_checksum_spec.rb
43
+ - spec/unit/defmastership/modifier/update_def_spec.rb
44
+ - spec/unit/defmastership/modifier/update_def_version_spec.rb
45
+ - spec/unit/defmastership/modifier/update_eref_checksum_spec.rb
46
+ - spec/unit/defmastership/modifier/update_eref_version_spec.rb
47
+ - spec/unit/defmastership/modifier/update_iref_checksum_spec.rb
48
+ - spec/unit/defmastership/modifier/update_iref_version_spec.rb
45
49
 
46
50
  Style/MissingElse:
47
51
  EnforcedStyle: case
@@ -72,8 +76,16 @@ RSpec/SpecFilePathSuffix :
72
76
  RSpec/NestedGroups:
73
77
  Max: 4
74
78
 
79
+ RSpec/AnyInstance:
80
+ Enabled: true
81
+ Exclude:
82
+ - spec/unit/defmastership/modifier/update_eref_checksum_spec.rb
83
+ - spec/unit/defmastership/modifier/update_eref_version_spec.rb
84
+ - spec/unit/defmastership/modifier/update_iref_checksum_spec.rb
85
+ - spec/unit/defmastership/modifier/update_iref_version_spec.rb
86
+
75
87
  Layout/RedundantLineBreak:
76
- Enabled: false
88
+ Enabled: true
77
89
 
78
90
  Style/DisableCopsWithinSourceCodeDirective:
79
91
  Enabled: true
@@ -3,21 +3,10 @@
3
3
 
4
4
  # Ensure we require the local version and not one we might have
5
5
  # installed already
6
- require(
7
- File.join(
8
- [
9
- File.dirname(__FILE__),
10
- 'lib',
11
- 'defmastership',
12
- 'version.rb'
13
- ]
14
- )
15
- )
6
+ require(File.join([File.dirname(__FILE__), 'lib', 'defmastership', 'version.rb']))
16
7
 
17
8
  Gem::Specification.new do |spec|
18
- spec.metadata = {
19
- 'rubygems_mfa_required' => 'true'
20
- }
9
+ spec.metadata = { 'rubygems_mfa_required' => 'true' }
21
10
  spec.required_ruby_version = '>= 3.0'
22
11
  spec.name = 'defmastership'
23
12
  spec.version = Defmastership::VERSION
@@ -34,9 +23,11 @@ Gem::Specification.new do |spec|
34
23
  spec.add_dependency('aasm', '~> 5.5')
35
24
  spec.add_dependency('asciidoctor', '~> 2.0')
36
25
  spec.add_dependency('csv', '~> 3.3')
37
- spec.add_dependency('defmastership-core', '~> 1.5')
26
+ spec.add_dependency('defmastership-core', '~> 1.5.5')
38
27
  spec.add_dependency('facets', '~> 3.1')
39
- spec.add_dependency('git', '~> 3.1')
28
+ spec.add_dependency('git', '~> 4.0')
40
29
  spec.add_dependency('gli', '~> 2.22')
30
+ spec.add_dependency('memoist', '~> 0.16')
41
31
  spec.add_dependency('ostruct', '~> 0.6')
32
+ spec.add_dependency('rubyXL', '~> 3.4')
42
33
  end
@@ -348,6 +348,36 @@ Feature: The changeref command
348
348
  | // tag::TOTO-TEMP-XXX1[] Whatever | // tag::TOTO-0123[] Whatever |
349
349
  | /* end::TOTO-TEMP-XXX1[] */ | /* end::TOTO-0123[] */ |
350
350
 
351
+ Scenario: Change definitions in subfolders, modify tags in included files
352
+ Given a file named "modifications.yml" with:
353
+ """
354
+ ---
355
+ :toto:
356
+ :type: change_ref
357
+ :config:
358
+ :from_regexp: TOTO-TEMP-[X\d]{4}
359
+ :to_template: TOTO-%<next_ref>04d
360
+ :next_ref: 123
361
+ """
362
+ And a directory named "any_path"
363
+ And a file named "any_path/thedoc.adoc" with:
364
+ """
365
+ [define, requirement, TOTO-TEMP-XXX1]
366
+ --
367
+ include::target[TOTO-TEMP-XXX1 ]
368
+ --
369
+ """
370
+ And a file named "any_path/target" with:
371
+ """
372
+ # tag::TOTO-TEMP-XXX1[]
373
+ """
374
+ When I successfully run `defmastership modify --modifications toto any_path/thedoc.adoc`
375
+ Then the stdout should not contain anything
376
+ And the file named "any_path/target" should contain:
377
+ """
378
+ # tag::TOTO-0123[]
379
+ """
380
+
351
381
  Scenario: Do not change definitions when in literal
352
382
  Given a file named "modifications.yml" with:
353
383
  """
@@ -383,3 +413,81 @@ Feature: The changeref command
383
413
  [define, requirement, TOTO-TEMP-XXX1]
384
414
  ....
385
415
  """
416
+
417
+ Scenario: Change a definition if the definitions's type fits with one value
418
+ Given a file named "modifications.yml" with:
419
+ """
420
+ ---
421
+ :toto:
422
+ :type: change_ref
423
+ :config:
424
+ :def_type: requirement
425
+ :from_regexp: TOTO-TEMP-[X\d]{4}
426
+ :to_template: TOTO-%<next_ref>04d
427
+ :next_ref: 123
428
+ """
429
+ And a file named "thedoc.adoc" with:
430
+ """
431
+ [define, requirement, TOTO-TEMP-XXX1]
432
+ [define, no_fit, TOTO-TEMP-XXX2]
433
+ """
434
+ When I successfully run `defmastership modify --modifications toto thedoc.adoc`
435
+ Then the stdout should not contain anything
436
+ And the file "modifications.yml" should contain:
437
+ """
438
+ ---
439
+ :toto:
440
+ :type: change_ref
441
+ :config:
442
+ :def_type: requirement
443
+ :from_regexp: TOTO-TEMP-[X\d]{4}
444
+ :to_template: TOTO-%<next_ref>04d
445
+ :next_ref: 124
446
+ """
447
+ And the file "thedoc.adoc" should contain:
448
+ """
449
+ [define, requirement, TOTO-0123]
450
+ [define, no_fit, TOTO-TEMP-XXX2]
451
+ """
452
+
453
+ Scenario: Change a definition if the definitions's type fits with a liste of values
454
+ Given a file named "modifications.yml" with:
455
+ """
456
+ ---
457
+ :toto:
458
+ :type: change_ref
459
+ :config:
460
+ :def_type:
461
+ - requirement
462
+ - pouet
463
+ :from_regexp: TOTO-TEMP-[X\d]{4}
464
+ :to_template: TOTO-%<next_ref>04d
465
+ :next_ref: 123
466
+ """
467
+ And a file named "thedoc.adoc" with:
468
+ """
469
+ [define, requirement, TOTO-TEMP-XXX1]
470
+ [define, not_included, TOTO-TEMP-XXX2]
471
+ [define, pouet, TOTO-TEMP-XXX3]
472
+ """
473
+ When I successfully run `defmastership modify --modifications toto thedoc.adoc`
474
+ Then the stdout should not contain anything
475
+ And the file "modifications.yml" should contain:
476
+ """
477
+ ---
478
+ :toto:
479
+ :type: change_ref
480
+ :config:
481
+ :def_type:
482
+ - requirement
483
+ - pouet
484
+ :from_regexp: TOTO-TEMP-[X\d]{4}
485
+ :to_template: TOTO-%<next_ref>04d
486
+ :next_ref: 125
487
+ """
488
+ And the file "thedoc.adoc" should contain:
489
+ """
490
+ [define, requirement, TOTO-0123]
491
+ [define, not_included, TOTO-TEMP-XXX2]
492
+ [define, pouet, TOTO-0124]
493
+ """
@@ -372,3 +372,121 @@ Feature: definition checksum
372
372
  the requirement value.
373
373
  --
374
374
  """
375
+
376
+ Scenario: Checksum update with not set def_type
377
+ Given a file named "modifications.yml" with:
378
+ """
379
+ ---
380
+ :update_requirement_checksum:
381
+ :type: update_def_checksum
382
+ """
383
+ And a file named "thedoc.adoc" with:
384
+ """
385
+ [define, requirement, TOTO-TEMP]
386
+ --
387
+ the requirement value.
388
+ --
389
+
390
+ [define, whatever, TUTU-TEMP]
391
+ --
392
+ the requirement value.
393
+ --
394
+ """
395
+ When I successfully run `defmastership modify --modifications update_requirement_checksum thedoc.adoc`
396
+ Then the stdout should not contain anything
397
+ And the file "thedoc.adoc" should contain:
398
+ """
399
+ [define, requirement, TOTO-TEMP(~244eed18)]
400
+ --
401
+ the requirement value.
402
+ --
403
+
404
+ [define, whatever, TUTU-TEMP(~244eed18)]
405
+ --
406
+ the requirement value.
407
+ --
408
+ """
409
+
410
+ Scenario: Checksum update with def_type set to all
411
+ Given a file named "modifications.yml" with:
412
+ """
413
+ ---
414
+ :update_requirement_checksum:
415
+ :type: update_def_checksum
416
+ :config:
417
+ :def_type: all
418
+ """
419
+ And a file named "thedoc.adoc" with:
420
+ """
421
+ [define, requirement, TOTO-TEMP]
422
+ --
423
+ the requirement value.
424
+ --
425
+
426
+ [define, whatever, TUTU-TEMP]
427
+ --
428
+ the requirement value.
429
+ --
430
+ """
431
+ When I successfully run `defmastership modify --modifications update_requirement_checksum thedoc.adoc`
432
+ Then the stdout should not contain anything
433
+ And the file "thedoc.adoc" should contain:
434
+ """
435
+ [define, requirement, TOTO-TEMP(~244eed18)]
436
+ --
437
+ the requirement value.
438
+ --
439
+
440
+ [define, whatever, TUTU-TEMP(~244eed18)]
441
+ --
442
+ the requirement value.
443
+ --
444
+ """
445
+
446
+ Scenario: Checksum update with def_type set to a list
447
+ Given a file named "modifications.yml" with:
448
+ """
449
+ ---
450
+ :update_requirement_checksum:
451
+ :type: update_def_checksum
452
+ :config:
453
+ :def_type:
454
+ - requirement
455
+ - pouet
456
+ """
457
+ And a file named "thedoc.adoc" with:
458
+ """
459
+ [define, requirement, TOTO-TEMP]
460
+ --
461
+ the requirement value.
462
+ --
463
+
464
+ [define, pouet, TITI-TEMP]
465
+ --
466
+ the requirement value.
467
+ --
468
+
469
+ [define, whatever, TUTU-TEMP]
470
+ --
471
+ the requirement value.
472
+ --
473
+ """
474
+ When I successfully run `defmastership modify --modifications update_requirement_checksum thedoc.adoc`
475
+ Then the stdout should not contain anything
476
+ And the file "thedoc.adoc" should contain:
477
+ """
478
+ [define, requirement, TOTO-TEMP(~244eed18)]
479
+ --
480
+ the requirement value.
481
+ --
482
+
483
+ [define, pouet, TITI-TEMP(~244eed18)]
484
+ --
485
+ the requirement value.
486
+ --
487
+
488
+ [define, whatever, TUTU-TEMP]
489
+ --
490
+ the requirement value.
491
+ --
492
+ """
@@ -435,3 +435,171 @@ Feature: definitions version
435
435
  --
436
436
  """
437
437
 
438
+ Scenario: Version update with not set def_type
439
+ Given a file named "ref_doc.adoc" with:
440
+ """
441
+ [define, requirement, TOTO-0001]
442
+ --
443
+ Requirement: initial text.
444
+ --
445
+
446
+ [define, whatever, TOTO-0002]
447
+ --
448
+ Whatever: initial text.
449
+ --
450
+
451
+ """
452
+ Given a file named "thedoc.adoc" with:
453
+ """
454
+ [define, requirement, TOTO-0001]
455
+ --
456
+ Requirement: modified text.
457
+ --
458
+
459
+ [define, whatever, TOTO-0002]
460
+ --
461
+ Whatever: modified text.
462
+ --
463
+ """
464
+ And a file named "modifications.yml" with:
465
+ """
466
+ ---
467
+ :update_requirement_version:
468
+ :type: update_def_version
469
+ :config:
470
+ :first_version: a
471
+ :ref_document: ./ref_doc.adoc
472
+ """
473
+ When I successfully run `defmastership modify --modifications update_requirement_version thedoc.adoc`
474
+ And the stdout should not contain anything
475
+ Then the file "thedoc.adoc" should contain:
476
+ """
477
+ [define, requirement, TOTO-0001(a)]
478
+ --
479
+ Requirement: modified text.
480
+ --
481
+
482
+ [define, whatever, TOTO-0002(a)]
483
+ --
484
+ Whatever: modified text.
485
+ --
486
+ """
487
+
488
+ Scenario: Version update with not set to all
489
+ Given a file named "ref_doc.adoc" with:
490
+ """
491
+ [define, requirement, TOTO-0001]
492
+ --
493
+ Requirement: initial text.
494
+ --
495
+
496
+ [define, whatever, TOTO-0002]
497
+ --
498
+ Whatever: initial text.
499
+ --
500
+
501
+ """
502
+ Given a file named "thedoc.adoc" with:
503
+ """
504
+ [define, requirement, TOTO-0001]
505
+ --
506
+ Requirement: modified text.
507
+ --
508
+
509
+ [define, whatever, TOTO-0002]
510
+ --
511
+ Whatever: modified text.
512
+ --
513
+ """
514
+ And a file named "modifications.yml" with:
515
+ """
516
+ ---
517
+ :update_requirement_version:
518
+ :type: update_def_version
519
+ :config:
520
+ :def_type: all
521
+ :first_version: a
522
+ :ref_document: ./ref_doc.adoc
523
+ """
524
+ When I successfully run `defmastership modify --modifications update_requirement_version thedoc.adoc`
525
+ And the stdout should not contain anything
526
+ Then the file "thedoc.adoc" should contain:
527
+ """
528
+ [define, requirement, TOTO-0001(a)]
529
+ --
530
+ Requirement: modified text.
531
+ --
532
+
533
+ [define, whatever, TOTO-0002(a)]
534
+ --
535
+ Whatever: modified text.
536
+ --
537
+ """
538
+
539
+ Scenario: Version update with not set to a list
540
+ Given a file named "ref_doc.adoc" with:
541
+ """
542
+ [define, requirement, TOTO-0001]
543
+ --
544
+ Requirement: initial text.
545
+ --
546
+
547
+ [define, pouet, TOTO-0003]
548
+ --
549
+ Pouet: initial text.
550
+ --
551
+
552
+ [define, whatever, TOTO-0002]
553
+ --
554
+ Whatever: initial text.
555
+ --
556
+
557
+ """
558
+ Given a file named "thedoc.adoc" with:
559
+ """
560
+ [define, requirement, TOTO-0001]
561
+ --
562
+ Requirement: modified text.
563
+ --
564
+
565
+ [define, pouet, TOTO-0003]
566
+ --
567
+ Pouet: modified text.
568
+ --
569
+
570
+ [define, whatever, TOTO-0002]
571
+ --
572
+ Whatever: modified text.
573
+ --
574
+ """
575
+ And a file named "modifications.yml" with:
576
+ """
577
+ ---
578
+ :update_requirement_version:
579
+ :type: update_def_version
580
+ :config:
581
+ :def_type:
582
+ - requirement
583
+ - pouet
584
+ :first_version: a
585
+ :ref_document: ./ref_doc.adoc
586
+ """
587
+ When I successfully run `defmastership modify --modifications update_requirement_version thedoc.adoc`
588
+ And the stdout should not contain anything
589
+ Then the file "thedoc.adoc" should contain:
590
+ """
591
+ [define, requirement, TOTO-0001(a)]
592
+ --
593
+ Requirement: modified text.
594
+ --
595
+
596
+ [define, pouet, TOTO-0003(a)]
597
+ --
598
+ Pouet: modified text.
599
+ --
600
+
601
+ [define, whatever, TOTO-0002]
602
+ --
603
+ Whatever: modified text.
604
+ --
605
+ """