defmastership 1.0.18 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -0
  3. data/.gitlab-ci.yml +42 -1
  4. data/Gemfile +49 -18
  5. data/Guardfile +44 -0
  6. data/LICENSE +1 -1
  7. data/README.adoc +24 -0
  8. data/Rakefile +0 -1
  9. data/bin/defmastership +5 -5
  10. data/config/cucumber.yml +3 -0
  11. data/config/mutant.yml +22 -16
  12. data/config/reek.yml +129 -105
  13. data/config/rubocop.yml +67 -28
  14. data/defmastership.gemspec +8 -6
  15. data/features/changeref.feature +0 -8
  16. data/features/definition_checksum.feature +0 -10
  17. data/features/definition_version.feature +168 -10
  18. data/features/export.feature +23 -18
  19. data/features/modify.feature +1 -5
  20. data/features/rename_included_files.feature +0 -5
  21. data/features/step_definitions/git_steps.rb +19 -0
  22. data/lib/defmastership/batch_modifier.rb +23 -5
  23. data/lib/defmastership/comment_filter.rb +2 -1
  24. data/lib/defmastership/definition.rb +26 -6
  25. data/lib/defmastership/definition_parser.rb +2 -2
  26. data/lib/defmastership/document.rb +45 -33
  27. data/lib/defmastership/export/body_formatter.rb +55 -0
  28. data/lib/defmastership/export/csv/formatter.rb +64 -0
  29. data/lib/defmastership/export/header_formatter.rb +51 -0
  30. data/lib/defmastership/filters.rb +15 -12
  31. data/lib/defmastership/matching_line.rb +3 -2
  32. data/lib/defmastership/modifier/change_ref.rb +117 -0
  33. data/lib/defmastership/modifier/factory.rb +17 -0
  34. data/lib/defmastership/modifier/modifier_common.rb +71 -0
  35. data/lib/defmastership/modifier/rename_included_files.rb +223 -0
  36. data/lib/defmastership/modifier/update_def.rb +72 -0
  37. data/lib/defmastership/modifier/update_def_checksum.rb +17 -0
  38. data/lib/defmastership/modifier/update_def_version.rb +110 -0
  39. data/lib/defmastership/set_join_hack.rb +2 -0
  40. data/lib/defmastership/version.rb +3 -2
  41. data/lib/defmastership.rb +6 -8
  42. data/spec/unit/{def_mastership → defmastership}/batch_modifier_spec.rb +15 -13
  43. data/spec/unit/{def_mastership → defmastership}/definition_parser_spec.rb +1 -1
  44. data/spec/unit/{def_mastership → defmastership}/definition_spec.rb +1 -1
  45. data/spec/unit/{def_mastership → defmastership}/document_spec.rb +57 -57
  46. data/spec/unit/{def_mastership/csv_formatter_body_spec.rb → defmastership/export/body_formatter_spec.rb} +4 -4
  47. data/spec/unit/{def_mastership/csv_formatter_spec.rb → defmastership/export/csv/formatter_spec.rb} +13 -8
  48. data/spec/unit/{def_mastership/csv_formatter_header_spec.rb → defmastership/export/header_formatter_spec.rb} +3 -3
  49. data/spec/unit/{def_mastership → defmastership}/matching_line_spec.rb +1 -1
  50. data/spec/unit/{def_mastership/change_ref_modifier_spec.rb → defmastership/modifier/change_ref_spec.rb} +19 -44
  51. data/spec/unit/defmastership/modifier/factory_spec.rb +45 -0
  52. data/spec/unit/{def_mastership/modifier_spec.rb → defmastership/modifier/modifier_common_spec.rb} +11 -18
  53. data/spec/unit/{def_mastership/rename_included_files_modifier_spec.rb → defmastership/modifier/rename_included_files_spec.rb} +3 -3
  54. data/spec/unit/{def_mastership/update_def_checksum_modifier_spec.rb → defmastership/modifier/update_def_checksum_spec.rb} +10 -10
  55. data/spec/unit/{def_mastership/update_def_modifier_spec.rb → defmastership/modifier/update_def_spec.rb} +22 -18
  56. data/spec/unit/defmastership/modifier/update_def_version_spec.rb +351 -0
  57. data/spec/unit/{def_mastership_spec.rb → defmastership_spec.rb} +2 -2
  58. data/tasks/code_quality.rake +74 -0
  59. data/tasks/documentation.rake +19 -0
  60. data/tasks/package.rake +4 -0
  61. data/tasks/test.rake +6 -21
  62. metadata +96 -51
  63. data/.rubocop.yml +0 -76
  64. data/README.rdoc +0 -6
  65. data/config/devtools.yml +0 -2
  66. data/config/flay.yml +0 -3
  67. data/config/flog.yml +0 -2
  68. data/config/yardstick.yml +0 -2
  69. data/cucumber.yml +0 -2
  70. data/defmastership.rdoc +0 -5
  71. data/lib/defmastership/change_ref_modifier.rb +0 -99
  72. data/lib/defmastership/constants.rb +0 -89
  73. data/lib/defmastership/csv_formatter.rb +0 -53
  74. data/lib/defmastership/csv_formatter_body.rb +0 -46
  75. data/lib/defmastership/csv_formatter_header.rb +0 -41
  76. data/lib/defmastership/modifier.rb +0 -42
  77. data/lib/defmastership/modifier_factory.rb +0 -12
  78. data/lib/defmastership/parsing_state.rb +0 -31
  79. data/lib/defmastership/rename_included_files_modifier.rb +0 -182
  80. data/lib/defmastership/update_def_checksum_modifier.rb +0 -16
  81. data/lib/defmastership/update_def_modifier.rb +0 -49
  82. data/lib/defmastership/update_def_version_modifier.rb +0 -66
  83. data/spec/unit/def_mastership/modifier_factory_spec.rb +0 -37
  84. data/spec/unit/def_mastership/parsing_state_spec.rb +0 -62
  85. data/spec/unit/def_mastership/update_def_version_modifier_spec.rb +0 -159
  86. data/tasks/package.task +0 -9
  87. data/tasks/smelling_code.rake +0 -38
  88. /data/{.rspec → config/rspec} +0 -0
  89. /data/spec/unit/{def_mastership → defmastership}/string_spec.rb +0 -0
data/config/rubocop.yml CHANGED
@@ -1,44 +1,83 @@
1
- inherit_from: ../.rubocop.yml
1
+ # The behavior of RuboCop can be controlled via the .rubocop.yml
2
+ # configuration file. It makes it possible to enable/disable
3
+ # certain cops (checks) and to alter their behavior if they accept
4
+ # any parameters. The file can be placed either in your home
5
+ # directory or in some project directory.
6
+ #
7
+ # RuboCop will start looking for the configuration file in the directory
8
+ # where the inspected file is and continue its way up to the root directory.
9
+ #
10
+ # See https://github.com/rubocop-hq/rubocop/blob/master/manual/configuration.md
2
11
 
3
12
  require:
13
+ - rubocop-performance
4
14
  - rubocop-rspec
15
+ - rubocop-rake
16
+ - rubocop-yard
5
17
 
6
18
  AllCops:
7
- TargetRubyVersion: 2.5.0
19
+ TargetRubyVersion: 2.7
20
+ EnabledByDefault: true
21
+ DisplayCopNames: true
8
22
 
9
- Metrics/BlockLength:
23
+ Style/Copyright:
24
+ Enabled: true
25
+ Notice: 'Copyright (\(c\) )?202[0-9] Jerome Arbez-Gindre'
26
+ AutocorrectNotice: '# Copyright (c) 2023 Jerome Arbez-Gindre'
27
+
28
+ Lint/ConstantResolution: # Not available ins rubocop 0.81
29
+ Enabled: false
30
+
31
+ Style/DocumentationMethod:
32
+ Enabled: false
33
+
34
+ Style/StringHashKeys :
35
+ Enabled: true
36
+ Exclude:
37
+ - '*.gemspec'
38
+ - 'spec/unit/defmastership/batch_modifier_spec.rb'
39
+ - 'spec/unit/defmastership/modifier/update_def_checksum_spec.rb'
40
+ - 'spec/unit/defmastership/modifier/update_def_spec.rb'
41
+ - 'spec/unit/defmastership/modifier/update_def_version_spec.rb'
42
+
43
+ Style/MissingElse:
44
+ EnforcedStyle: case
45
+
46
+ Metrics/ModuleLength :
47
+ Exclude:
48
+ - 'spec/**/*'
49
+
50
+ Metrics/BlockLength :
10
51
  Exclude:
11
- # Ignore RSpec DSL
12
- - spec/**/*
13
- # Ignore gemspec DSL
52
+ - 'spec/**/*'
14
53
  - '*.gemspec'
15
54
 
16
- # Naming/FileName:
17
- # Exclude:
18
- # - Rakefile
55
+ Security/Eval :
56
+ Exclude:
57
+ - 'Rakefile'
58
+
59
+ # rubocop-rspec options
60
+ RSpec/MessageExpectation :
61
+ Enabled: true
62
+
63
+ RSpec/SpecFilePathFormat :
64
+ Enabled: true
19
65
 
20
- # Avoid more than `Max` levels of nesting.
21
- BlockNesting:
22
- Max: 3
66
+ RSpec/SpecFilePathSuffix :
67
+ Enabled: true
23
68
 
24
- # Align with the style guide.
25
- CollectionMethods:
26
- PreferredMethods:
27
- collect: 'map'
28
- inject: 'reduce'
29
- find: 'detect'
30
- find_all: 'sélect'
69
+ RSpec/NestedGroups:
70
+ Max: 4
31
71
 
32
- # Prefer #kind_of? over #is_a?
33
- ClassCheck:
34
- EnforcedStyle: kind_of?
72
+ Layout/RedundantLineBreak:
73
+ Enabled: false
35
74
 
36
- Security/Eval:
75
+ Style/DisableCopsWithinSourceCodeDirective:
76
+ Enabled: true
37
77
  Exclude:
38
- - Rakefile
78
+ - 'Gemfile'
79
+ - 'tasks/code_quality.rake'
39
80
 
40
- AlignHash:
41
- EnforcedColonStyle: table
81
+ Layout/EndOfLine:
82
+ EnforcedStyle: lf
42
83
 
43
- MessageSpies:
44
- EnforcedStyle: receive
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  }
21
21
  spec.required_ruby_version = '>= 2.7'
22
22
  spec.name = 'defmastership'
23
- spec.version = DefMastership::VERSION
23
+ spec.version = Defmastership::VERSION
24
24
  spec.author = 'Jérôme Arbez-Gindre'
25
25
  spec.email = 'jeromearbezgindre@gmail.com'
26
26
  spec.licenses = ['MIT']
@@ -29,11 +29,13 @@ Gem::Specification.new do |spec|
29
29
  spec.summary = 'Handling of references and definitions with asciidoctor'
30
30
  spec.files = `git ls-files`.split("\n")
31
31
  spec.require_paths << 'lib'
32
- spec.extra_rdoc_files = ['README.rdoc', 'defmastership.rdoc']
33
- spec.rdoc_options << '--title defmastership' << '--main README.rdoc' << '-ri'
34
32
  spec.bindir = 'bin'
35
33
  spec.executables << 'defmastership'
36
- spec.add_runtime_dependency('aasm', '~> 5')
37
- spec.add_runtime_dependency('asciidoctor', '~> 2')
38
- spec.add_runtime_dependency('gli', '~> 2')
34
+ spec.add_dependency('aasm', '~> 5')
35
+ spec.add_dependency('asciidoctor', '~> 2')
36
+ spec.add_dependency('csv', '~> 3')
37
+ spec.add_dependency('defmastership-core', '>= 1.1.0')
38
+ spec.add_dependency('git', '~> 1')
39
+ spec.add_dependency('gli', '~> 2')
40
+ spec.add_dependency('ostruct', '~> 0')
39
41
  end
@@ -20,7 +20,6 @@ Feature: The changeref command
20
20
  """
21
21
  When I successfully run `defmastership modify --modifications toto thedoc.adoc`
22
22
  Then the stdout should not contain anything
23
- And the stderr should not contain anything
24
23
  And the file "modifications.yml" should contain:
25
24
  """
26
25
  ---
@@ -53,7 +52,6 @@ Feature: The changeref command
53
52
  """
54
53
  When I successfully run `defmastership modify --modifications toto thedoc.adoc`
55
54
  Then the stdout should not contain anything
56
- And the stderr should not contain anything
57
55
  And the file "modifications.yml" should contain:
58
56
  """
59
57
  ---
@@ -87,7 +85,6 @@ Feature: The changeref command
87
85
  """
88
86
  When I successfully run `defmastership modify --modifications toto thedoc.adoc`
89
87
  Then the stdout should not contain anything
90
- And the stderr should not contain anything
91
88
  And the file "modifications.yml" should contain:
92
89
  """
93
90
  ---
@@ -122,7 +119,6 @@ Feature: The changeref command
122
119
  """
123
120
  When I successfully run `defmastership modify --modifications tata_or_titi thedoc.adoc`
124
121
  Then the stdout should not contain anything
125
- And the stderr should not contain anything
126
122
  And the file "modifications.yml" should contain:
127
123
  """
128
124
  ---
@@ -160,7 +156,6 @@ Feature: The changeref command
160
156
  """
161
157
  When I successfully run `defmastership modify --modifications toto thedoc.adoc thedoc2.adoc`
162
158
  Then the stdout should not contain anything
163
- And the stderr should not contain anything
164
159
  And the file "modifications.yml" should contain:
165
160
  """
166
161
  ---
@@ -200,7 +195,6 @@ Feature: The changeref command
200
195
  """
201
196
  When I successfully run `defmastership modify --modifications toto thedoc.adoc`
202
197
  Then the stdout should not contain anything
203
- And the stderr should not contain anything
204
198
  And the file "thedoc.adoc" should contain:
205
199
  """
206
200
  [define, requirement, TOTO-0123]
@@ -232,7 +226,6 @@ Feature: The changeref command
232
226
  """
233
227
  When I successfully run `defmastership modify --modifications toto thedoc.adoc thedoc2.adoc`
234
228
  Then the stdout should not contain anything
235
- And the stderr should not contain anything
236
229
  And the file "thedoc.adoc" should contain:
237
230
  """
238
231
  [define, requirement, TOTO-0123]
@@ -263,7 +256,6 @@ Feature: The changeref command
263
256
  """
264
257
  When I successfully run `defmastership modify --modifications toto thedoc.adoc`
265
258
  Then the stdout should not contain anything
266
- And the stderr should not contain anything
267
259
  And the file "modifications.yml" should contain:
268
260
  """
269
261
  ---
@@ -82,7 +82,6 @@ Feature: definition checksum
82
82
  Second line.",~b86dcbde
83
83
  """
84
84
  And the stdout should not contain anything
85
- And the stderr should not contain anything
86
85
 
87
86
  Scenario: Change one modifier
88
87
  Given a file named "modifications.yml" with:
@@ -102,7 +101,6 @@ Feature: definition checksum
102
101
  """
103
102
  When I successfully run `defmastership modify --modifications update_requirement_checksum thedoc.adoc`
104
103
  Then the stdout should not contain anything
105
- And the stderr should not contain anything
106
104
  And the file "thedoc.adoc" should contain:
107
105
  """
108
106
  [define, requirement, TOTO-TEMP-XXX1(~244eed18)]
@@ -129,7 +127,6 @@ Feature: definition checksum
129
127
  """
130
128
  When I successfully run `defmastership modify --modifications update_requirement_checksum thedoc.adoc`
131
129
  Then the stdout should not contain anything
132
- And the stderr should not contain anything
133
130
  And the file "thedoc.adoc" should contain:
134
131
  """
135
132
  [define, requirement, TOTO-TEMP-XXX1(~244eed18)]
@@ -159,7 +156,6 @@ Feature: definition checksum
159
156
  Second line.",~b86dcbde
160
157
  """
161
158
  And the stdout should not contain anything
162
- And the stderr should not contain anything
163
159
 
164
160
  Scenario: Checksum is calculated on included file in ref modification
165
161
  Given a file named "modifications.yml" with:
@@ -191,7 +187,6 @@ Feature: definition checksum
191
187
  --
192
188
  """
193
189
  And the stdout should not contain anything
194
- And the stderr should not contain anything
195
190
 
196
191
  Scenario: Checksum take into account variables in CSV export
197
192
  Given a file named "thedoc.adoc" with:
@@ -211,7 +206,6 @@ Feature: definition checksum
211
206
  Second line.",~b86dcbde
212
207
  """
213
208
  And the stdout should not contain anything
214
- And the stderr should not contain anything
215
209
 
216
210
  Scenario: Checksum takes into account variables in ref modification
217
211
  Given a file named "modifications.yml" with:
@@ -241,7 +235,6 @@ Feature: definition checksum
241
235
  --
242
236
  """
243
237
  And the stdout should not contain anything
244
- And the stderr should not contain anything
245
238
 
246
239
  Scenario: Checksum does not take into account bad variables definition
247
240
  Given a file named "modifications.yml" with:
@@ -271,7 +264,6 @@ Feature: definition checksum
271
264
  --
272
265
  """
273
266
  And the stdout should not contain anything
274
- And the stderr should not contain anything
275
267
 
276
268
  Scenario: Checksum keep explicit version in ref modification
277
269
  Given a file named "modifications.yml" with:
@@ -291,7 +283,6 @@ Feature: definition checksum
291
283
  """
292
284
  When I successfully run `defmastership modify --modifications update_requirement_checksum thedoc.adoc`
293
285
  Then the stdout should not contain anything
294
- And the stderr should not contain anything
295
286
  And the file "thedoc.adoc" should contain:
296
287
  """
297
288
  [define, requirement, TOTO-TEMP-XXX1(toto~244eed18)]
@@ -318,7 +309,6 @@ Feature: definition checksum
318
309
  """
319
310
  When I successfully run `defmastership modify --modifications update_requirement_checksum thedoc.adoc`
320
311
  Then the stdout should not contain anything
321
- And the stderr should not contain anything
322
312
  And the file "thedoc.adoc" should contain:
323
313
  """
324
314
  [define, requirement, TOTO-TEMP-XXX1(toto~244eed18)]
@@ -1,9 +1,9 @@
1
- Feature: definitions version
2
- As a Responsible of definitions for a given document
1
+ Feature: definitions version
2
+ As a Responsible of definitions for a given document
3
3
  In order to detect handle versions definitions
4
4
  I want defmastership to export explicit versions in definitions
5
5
 
6
- Scenario: Extract one definition with explicit version to CSV
6
+ Scenario: Extract one definition with explicit version to CSV
7
7
  Given a file named "thedoc.adoc" with:
8
8
  """
9
9
  [define, requirement, TOTO-0001(pouet)]
@@ -20,9 +20,8 @@ Feature: definitions version
20
20
  Second line.",~b86dcbde,pouet
21
21
  """
22
22
  And the stdout should not contain anything
23
- And the stderr should not contain anything
24
23
 
25
- Scenario: Set initial explicit version when definition has changed
24
+ Scenario: Set initial explicit version when definition has changed
26
25
  Given a file named "ref_doc.adoc" with:
27
26
  """
28
27
  [define, requirement, TOTO-0001]
@@ -49,7 +48,170 @@ Feature: definitions version
49
48
  """
50
49
  When I successfully run `defmastership modify --modifications update_requirement_version thedoc.adoc`
51
50
  And the stdout should not contain anything
52
- And the stderr should not contain anything
51
+ Then the file "thedoc.adoc" should contain:
52
+ """
53
+ [define, requirement, TOTO-0001(a)]
54
+ --
55
+ modified text.
56
+ --
57
+ """
58
+
59
+ Scenario: Set initial explicit version when definition has changed with multiple ref_files
60
+ Given a file named "ref_doc1.adoc" with:
61
+ """
62
+ [define, requirement, TOTO-0001]
63
+ --
64
+ initial text 1.
65
+ --
66
+ """
67
+ Given a file named "ref_doc2.adoc" with:
68
+ """
69
+ [define, requirement, TOTO-0002(z)]
70
+ --
71
+ initial text 2.
72
+ --
73
+ """
74
+ Given a file named "thedoc.adoc" with:
75
+ """
76
+ [define, requirement, TOTO-0001(whatever)]
77
+ --
78
+ modified text.
79
+ --
80
+
81
+ [define, requirement, TOTO-0002(whatever)]
82
+ --
83
+ modified text again.
84
+ --
85
+ """
86
+ And a file named "modifications.yml" with:
87
+ """
88
+ ---
89
+ :update_requirement_version:
90
+ :type: update_def_version
91
+ :config:
92
+ :def_type: requirement
93
+ :first_version: a
94
+ :ref_document: ['./ref_doc1.adoc', './ref_doc2.adoc']
95
+ """
96
+ When I successfully run `defmastership modify --modifications update_requirement_version thedoc.adoc`
97
+ And the stdout should not contain anything
98
+ Then the file "thedoc.adoc" should contain:
99
+ """
100
+ [define, requirement, TOTO-0001(a)]
101
+ --
102
+ modified text.
103
+ --
104
+
105
+ [define, requirement, TOTO-0002(aa)]
106
+ --
107
+ modified text again.
108
+ --
109
+ """
110
+
111
+ Scenario: Update explicit version based on git tag
112
+ Given I initialize a git repo
113
+ And a file named "thedoc.adoc" with:
114
+ """
115
+ [define, requirement, TOTO-0001]
116
+ --
117
+ initial text.
118
+ --
119
+ """
120
+ And I add and commit the "thedoc.adoc" file
121
+ And I set the "THE_TAG" tag
122
+ And a file named "thedoc.adoc" with:
123
+ """
124
+ [define, requirement, TOTO-0001(whatever)]
125
+ --
126
+ modified text.
127
+ --
128
+ """
129
+ And a file named "modifications.yml" with:
130
+ """
131
+ ---
132
+ :update_requirement_version:
133
+ :type: update_def_version
134
+ :config:
135
+ :def_type: requirement
136
+ :first_version: a
137
+ :ref_tag: 'THE_TAG'
138
+ """
139
+ When I successfully run `defmastership modify --modifications update_requirement_version thedoc.adoc`
140
+ And the stdout should not contain anything
141
+ Then the file "thedoc.adoc" should contain:
142
+ """
143
+ [define, requirement, TOTO-0001(a)]
144
+ --
145
+ modified text.
146
+ --
147
+ """
148
+
149
+ Scenario: Update explicit version based on git tag on a different git repo
150
+ And a file named "defmastership-example.adoc" with:
151
+ """
152
+ [define, whatever, WHATEVER-0001]
153
+ Simplest ever definition. !modified!
154
+ With a single paragraph.
155
+ """
156
+ And a file named "modifications.yml" with:
157
+ """
158
+ ---
159
+ :update_requirement_version:
160
+ :type: update_def_version
161
+ :config:
162
+ :def_type: whatever
163
+ :first_version: a
164
+ :ref_tag: 'TEST_UPDATE_VERSION'
165
+ :ref_repo: 'https://gitlab.com/defmastership/defmastership-example.git'
166
+ """
167
+ When I successfully run `defmastership modify --modifications update_requirement_version defmastership-example.adoc`
168
+ And the stdout should not contain anything
169
+ Then the file "defmastership-example.adoc" should contain:
170
+ """
171
+ [define, whatever, WHATEVER-0001(a)]
172
+ Simplest ever definition. !modified!
173
+ With a single paragraph.
174
+ """
175
+
176
+ Scenario: Update explicit version based on git tag and different filename
177
+ Given I initialize a git repo
178
+ And a file named "ref_doc.adoc" with:
179
+ """
180
+ [define, requirement, TOTO-0001]
181
+ --
182
+ initial text.
183
+ --
184
+ """
185
+ And I add and commit the "ref_doc.adoc" file
186
+ And I set the "THE_TAG" tag
187
+ And I remove the file "ref_doc.adoc"
188
+ And a file named "thedoc.adoc" with:
189
+ """
190
+ [define, requirement, TOTO-0001(whatever)]
191
+ --
192
+ modified text.
193
+ --
194
+ """
195
+ And a file named "ref_doc.adoc" with:
196
+ """
197
+ [define, requirement, TOTO-0001(whatever)]
198
+ --
199
+ modified text.
200
+ --
201
+ """
202
+ And a file named "modifications.yml" with:
203
+ """
204
+ ---
205
+ :update_requirement_version:
206
+ :type: update_def_version
207
+ :config:
208
+ :def_type: requirement
209
+ :first_version: a
210
+ :ref_document: ./ref_doc.adoc
211
+ :ref_tag: 'THE_TAG'
212
+ """
213
+ When I successfully run `defmastership modify --modifications update_requirement_version thedoc.adoc`
214
+ And the stdout should not contain anything
53
215
  Then the file "thedoc.adoc" should contain:
54
216
  """
55
217
  [define, requirement, TOTO-0001(a)]
@@ -85,7 +247,6 @@ Feature: definitions version
85
247
  """
86
248
  When I successfully run `defmastership modify --modifications update_requirement_version thedoc.adoc`
87
249
  And the stdout should not contain anything
88
- And the stderr should not contain anything
89
250
  Then the file "thedoc.adoc" should contain:
90
251
  """
91
252
  [define, requirement, TOTO-0001]
@@ -121,7 +282,6 @@ Feature: definitions version
121
282
  """
122
283
  When I successfully run `defmastership modify --modifications update_requirement_version thedoc.adoc`
123
284
  And the stdout should not contain anything
124
- And the stderr should not contain anything
125
285
  Then the file "thedoc.adoc" should contain:
126
286
  """
127
287
  [define, requirement, TOTO-0001(4)]
@@ -157,7 +317,6 @@ Feature: definitions version
157
317
  """
158
318
  When I successfully run `defmastership modify --modifications update_requirement_version thedoc.adoc`
159
319
  And the stdout should not contain anything
160
- And the stderr should not contain anything
161
320
  Then the file "thedoc.adoc" should contain:
162
321
  """
163
322
  [define, requirement, TOTO-0001]
@@ -193,7 +352,6 @@ Feature: definitions version
193
352
  """
194
353
  When I successfully run `defmastership modify --modifications update_requirement_version thedoc.adoc`
195
354
  And the stdout should not contain anything
196
- And the stderr should not contain anything
197
355
  Then the file "thedoc.adoc" should contain:
198
356
  """
199
357
  [define, requirement, TOTO-0001(a~abcd1234)]
@@ -20,7 +20,6 @@ Feature: The extract command
20
20
  Second line.",~b86dcbde
21
21
  """
22
22
  And the stdout should not contain anything
23
- And the stderr should not contain anything
24
23
 
25
24
  Scenario: Extract to CSV with alternative CSV separator
26
25
  Given a file named "toto.adoc" with:
@@ -60,7 +59,6 @@ Feature: The extract command
60
59
  Third line with {not_defined_variable}.",~3bf370ed
61
60
  """
62
61
  And the stdout should not contain anything
63
- And the stderr should not contain anything
64
62
 
65
63
 
66
64
  Scenario: Extract some definitions to CSV
@@ -93,7 +91,6 @@ Feature: The extract command
93
91
  ignored multiline
94
92
  """
95
93
  And the stdout should not contain anything
96
- And the stderr should not contain anything
97
94
 
98
95
  Scenario: Ignore definitions in literal block
99
96
  Given a file named "toto.adoc" with:
@@ -114,7 +111,6 @@ Feature: The extract command
114
111
  something_else
115
112
  """
116
113
  And the stdout should not contain anything
117
- And the stderr should not contain anything
118
114
 
119
115
  Scenario: Ignore definitions in example block
120
116
  Given a file named "toto.adoc" with:
@@ -135,7 +131,6 @@ Feature: The extract command
135
131
  something_else
136
132
  """
137
133
  And the stdout should not contain anything
138
- And the stderr should not contain anything
139
134
 
140
135
  Scenario: Ignore definitions in commment block
141
136
  Given a file named "toto.adoc" with:
@@ -156,7 +151,6 @@ Feature: The extract command
156
151
  something_else
157
152
  """
158
153
  And the stdout should not contain anything
159
- And the stderr should not contain anything
160
154
 
161
155
  Scenario: Handle mixes comment and literal blocks
162
156
  Given a file named "toto.adoc" with:
@@ -179,7 +173,6 @@ Feature: The extract command
179
173
  something_else
180
174
  """
181
175
  And the stdout should not contain anything
182
- And the stderr should not contain anything
183
176
 
184
177
  Scenario: Extract definition with labels
185
178
  Given a file named "toto.adoc" with:
@@ -199,7 +192,6 @@ Feature: The extract command
199
192
  label2"
200
193
  """
201
194
  And the stdout should not contain anything
202
- And the stderr should not contain anything
203
195
 
204
196
  Scenario: Extract one definition with external ref to CSV
205
197
  Given a file named "toto.adoc" with:
@@ -222,7 +214,29 @@ Feature: The extract command
222
214
  SYSTEM-0014"
223
215
  """
224
216
  And the stdout should not contain anything
225
- And the stderr should not contain anything
217
+
218
+ Scenario: Extract one definition with external ref (with version and checksum) to CSV
219
+ Given a file named "toto.adoc" with:
220
+ """
221
+ :eref-implements-prefix: Participate to:
222
+ :eref-implements-url: ./the_other_document.html
223
+ [define, requirement, TOTO-0001]
224
+ --
225
+ Exemple of multiline requirement.
226
+ Second line.
227
+ --
228
+ defs:eref[implements, [SYSTEM-0012(a), SYSTEM-0014, SYSTEM-0015(b~1223abcd)]]
229
+ """
230
+ When I successfully run `defmastership export toto.adoc`
231
+ Then the file "toto.csv" should contain:
232
+ """
233
+ Type,Reference,Value,Checksum,Participate to:
234
+ requirement,TOTO-0001,"Exemple of multiline requirement.
235
+ Second line.",~b86dcbde,"SYSTEM-0012(a)
236
+ SYSTEM-0014
237
+ SYSTEM-0015(b~1223abcd)"
238
+ """
239
+ And the stdout should not contain anything
226
240
 
227
241
  Scenario: Extract one definition with missing external ref to CSV
228
242
  Given a file named "toto.adoc" with:
@@ -243,7 +257,6 @@ Feature: The extract command
243
257
  Second line.",~b86dcbde,
244
258
  """
245
259
  And the stdout should not contain anything
246
- And the stderr should not contain anything
247
260
 
248
261
  Scenario: Extract one definition with external ref without url to CSV
249
262
  Given a file named "toto.adoc" with:
@@ -266,7 +279,6 @@ Feature: The extract command
266
279
  SYSTEM-0014"
267
280
  """
268
281
  And the stdout should not contain anything
269
- And the stderr should not contain anything
270
282
 
271
283
  Scenario: Extract one definition with external ref to CSV without URL
272
284
  Given a file named "toto.adoc" with:
@@ -281,7 +293,6 @@ Feature: The extract command
281
293
  """
282
294
  When I successfully run `defmastership export toto.adoc`
283
295
  Then the stdout should not contain anything
284
- And the stderr should not contain anything
285
296
  And the file "toto.csv" should contain:
286
297
  """
287
298
  Type,Reference,Value,Checksum,Participate to:
@@ -310,7 +321,6 @@ Feature: The extract command
310
321
  TOTO-0002"
311
322
  """
312
323
  And the stdout should not contain anything
313
- And the stderr should not contain anything
314
324
 
315
325
  Scenario: Extract one definition with attributes to CSV
316
326
  Given a file named "toto.adoc" with:
@@ -332,7 +342,6 @@ Feature: The extract command
332
342
  requirement,TOTO-0001,One single line.,~554b0ff5,Beautiful Test,Very cool
333
343
  """
334
344
  And the stdout should not contain anything
335
- And the stderr should not contain anything
336
345
 
337
346
  Scenario: Extract one definition with missing attributes to CSV
338
347
  Given a file named "toto.adoc" with:
@@ -353,7 +362,6 @@ Feature: The extract command
353
362
  requirement,TOTO-0001,One single line.,~554b0ff5,Beautiful Test,
354
363
  """
355
364
  And the stdout should not contain anything
356
- And the stderr should not contain anything
357
365
 
358
366
  Scenario: Extract one definition with example in it
359
367
  Given a file named "toto.adoc" with:
@@ -378,7 +386,6 @@ Feature: The extract command
378
386
  ----",~8f20a443
379
387
  """
380
388
  And the stdout should not contain anything
381
- And the stderr should not contain anything
382
389
 
383
390
  Scenario: Extract one definition with single line comment in it
384
391
  Given a file named "toto.adoc" with:
@@ -395,7 +402,6 @@ Feature: The extract command
395
402
  requirement,TOTO-0001,// comment,~b0b506c3
396
403
  """
397
404
  And the stdout should not contain anything
398
- And the stderr should not contain anything
399
405
 
400
406
  Scenario: Extract one definition with multi line comment or literal in it
401
407
  Given a file named "toto.adoc" with:
@@ -422,4 +428,3 @@ Feature: The extract command
422
428
  ....",~7eb3c490
423
429
  """
424
430
  And the stdout should not contain anything
425
- And the stderr should not contain anything
@@ -20,7 +20,6 @@ Feature: The modify command
20
20
  """
21
21
  When I successfully run `defmastership modify --modifications temp-references thedoc.adoc`
22
22
  Then the stdout should not contain anything
23
- And the stderr should not contain anything
24
23
  And the file "modifications.yml" should contain:
25
24
  """
26
25
  ---
@@ -75,7 +74,6 @@ Feature: The modify command
75
74
  """
76
75
  When I successfully run `defmastership modify --modifications-file=pouet.yml --modifications toto thedoc.adoc`
77
76
  Then the stdout should not contain anything
78
- And the stderr should not contain anything
79
77
  And the file "pouet.yml" should contain:
80
78
  """
81
79
  ---
@@ -108,8 +106,7 @@ Feature: The modify command
108
106
  [define, requirement, TOTO-TEMP-XXX2]
109
107
  """
110
108
  When I successfully run `defmastership modify --modifications temp-references --changes-summary=changes.csv thedoc.adoc`
111
- Then the stderr should not contain anything
112
- And the stdout should not contain anything
109
+ Then the stdout should not contain anything
113
110
  And the file "changes.csv" should contain:
114
111
  """
115
112
  Modifier,Was,Becomes
@@ -141,7 +138,6 @@ Feature: The modify command
141
138
  """
142
139
  When I successfully run `defmastership modify --modifications temp-references,tata_or_titi --changes-summary=changes.csv thedoc.adoc`
143
140
  Then the stdout should not contain anything
144
- And the stderr should not contain anything
145
141
  And the file "modifications.yml" should contain:
146
142
  """
147
143
  ---