defmastership 1.0.17 → 1.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +22 -10
- data/Gemfile +51 -1
- data/Rakefile +16 -61
- data/bin/defmastership +9 -6
- data/config/mutant.yml +23 -3
- data/defmastership.gemspec +0 -10
- data/features/definition_checksum.feature +31 -1
- data/features/export.feature +43 -1
- data/features/rename_included_files.feature +28 -0
- data/lib/defmastership/batch_modifier.rb +17 -12
- data/lib/defmastership/change_ref_modifier.rb +88 -6
- data/lib/defmastership/comment_filter.rb +1 -1
- data/lib/defmastership/constants.rb +5 -4
- data/lib/defmastership/csv_formatter.rb +16 -12
- data/lib/defmastership/csv_formatter_body.rb +18 -15
- data/lib/defmastership/csv_formatter_header.rb +1 -1
- data/lib/defmastership/definition.rb +58 -19
- data/lib/defmastership/document.rb +109 -74
- data/lib/defmastership/matching_line.rb +17 -0
- data/lib/defmastership/modifier.rb +42 -0
- data/lib/defmastership/modifier_factory.rb +12 -0
- data/lib/defmastership/parsing_state.rb +15 -9
- data/lib/defmastership/rename_included_files_modifier.rb +172 -5
- data/lib/defmastership/set_join_hack.rb +11 -0
- data/lib/defmastership/update_def_checksum_modifier.rb +8 -13
- data/lib/defmastership/update_def_modifier.rb +49 -0
- data/lib/defmastership/update_def_version_modifier.rb +56 -15
- data/lib/defmastership/version.rb +1 -1
- data/lib/defmastership.rb +1 -6
- data/spec/spec_helper.rb +3 -1
- data/spec/unit/def_mastership/batch_modifier_spec.rb +38 -36
- data/spec/unit/def_mastership/change_ref_modifier_spec.rb +196 -51
- data/spec/unit/def_mastership/csv_formatter_body_spec.rb +60 -31
- data/spec/unit/def_mastership/csv_formatter_header_spec.rb +1 -1
- data/spec/unit/def_mastership/csv_formatter_spec.rb +79 -87
- data/spec/unit/def_mastership/definition_parser_spec.rb +1 -1
- data/spec/unit/def_mastership/definition_spec.rb +16 -6
- data/spec/unit/def_mastership/document_spec.rb +81 -38
- data/spec/unit/def_mastership/matching_line_spec.rb +37 -0
- data/spec/unit/def_mastership/modifier_factory_spec.rb +37 -0
- data/spec/unit/def_mastership/modifier_spec.rb +83 -0
- data/spec/unit/def_mastership/parsing_state_spec.rb +1 -1
- data/spec/unit/def_mastership/rename_included_files_modifier_spec.rb +219 -47
- data/spec/unit/def_mastership/string_spec.rb +1 -1
- data/spec/unit/def_mastership/update_def_checksum_modifier_spec.rb +82 -50
- data/spec/unit/def_mastership/update_def_modifier_spec.rb +119 -0
- data/spec/unit/def_mastership/update_def_version_modifier_spec.rb +135 -56
- data/tasks/console.rake +8 -0
- data/tasks/package.task +9 -0
- data/tasks/smelling_code.rake +38 -0
- data/tasks/test.rake +45 -0
- metadata +16 -153
- data/lib/defmastership/change_ref_line_modifier.rb +0 -85
- data/lib/defmastership/line_modifier_base.rb +0 -29
- data/lib/defmastership/modifier_base.rb +0 -36
- data/lib/defmastership/rename_included_files_line_modifier.rb +0 -126
- data/lib/defmastership/update_def_checksum_line_modifier.rb +0 -38
- data/lib/defmastership/update_def_version_line_modifier.rb +0 -58
- data/spec/unit/def_mastership/change_ref_line_modifier_spec.rb +0 -250
- data/spec/unit/def_mastership/rename_included_files_line_modifier_spec.rb +0 -207
- data/spec/unit/def_mastership/update_def_checksum_line_modifier_spec.rb +0 -82
- data/spec/unit/def_mastership/update_def_version_line_modifier_spec.rb +0 -131
@@ -0,0 +1,119 @@
|
|
1
|
+
# Copyright (c) 2020 Jerome Arbez-Gindre
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require('defmastership/update_def_modifier')
|
5
|
+
|
6
|
+
module DefMastership
|
7
|
+
class ConcreteRefModifier < UpdateDefModifier
|
8
|
+
private
|
9
|
+
|
10
|
+
def reference_replacement(reference, match)
|
11
|
+
"#{reference}_something_#{match[:explicit_version]}"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
RSpec.describe(DefMastership::UpdateDefModifier) do
|
17
|
+
subject(:modifier) { DefMastership::ConcreteRefModifier.new({}) }
|
18
|
+
|
19
|
+
describe '.new' do
|
20
|
+
it { expect(described_class.ancestors).to(include(DefMastership::Modifier)) }
|
21
|
+
it { is_expected.not_to(be_nil) }
|
22
|
+
it { is_expected.to(have_attributes(def_type: '')) }
|
23
|
+
end
|
24
|
+
|
25
|
+
describe '.replacement_methods' do
|
26
|
+
it { expect(described_class.replacement_methods).to(eq(%i[replace_reference])) }
|
27
|
+
end
|
28
|
+
|
29
|
+
describe '#do_modifications' do
|
30
|
+
subject(:modifier) { DefMastership::ConcreteRefModifier.new({ def_type: 'req' }) }
|
31
|
+
|
32
|
+
let(:document) { instance_double(DefMastership::Document, 'document') }
|
33
|
+
let(:definition) { instance_double(DefMastership::Definition, 'definition') }
|
34
|
+
let(:definitions) { { 'REFERENCE' => definition } }
|
35
|
+
let(:adoc_sources) do
|
36
|
+
{
|
37
|
+
'file1.adoc' => "[define,req,REFERENCE]\nfile1 line2",
|
38
|
+
'file2.adoc' => "file2 line1\nfile2 line2"
|
39
|
+
}
|
40
|
+
end
|
41
|
+
let(:new_adoc_sources) { nil }
|
42
|
+
|
43
|
+
before do
|
44
|
+
allow(DefMastership::Document).to(receive(:new).and_return(document))
|
45
|
+
allow(document).to(receive(:parse_file_with_preprocessor).with('file1.adoc'))
|
46
|
+
allow(document).to(receive(:parse_file_with_preprocessor).with('file2.adoc'))
|
47
|
+
|
48
|
+
modifier.do_modifications(adoc_sources)
|
49
|
+
end
|
50
|
+
|
51
|
+
it { expect(DefMastership::Document).to(have_received(:new)) }
|
52
|
+
|
53
|
+
it do
|
54
|
+
expect(document).to(
|
55
|
+
have_received(:parse_file_with_preprocessor)
|
56
|
+
.once.with('file1.adoc')
|
57
|
+
.once.with('file2.adoc')
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
it do
|
62
|
+
expect(modifier.do_modifications(adoc_sources).fetch('file1.adoc'))
|
63
|
+
.to(include('REFERENCE_something_'))
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
describe '#replace_reference' do
|
68
|
+
subject(:modifier) do
|
69
|
+
DefMastership::ConcreteRefModifier.new(
|
70
|
+
def_type: 'requirement'
|
71
|
+
)
|
72
|
+
end
|
73
|
+
|
74
|
+
let(:definition) { instance_double(DefMastership::Definition, 'definition') }
|
75
|
+
let(:document) { instance_double(DefMastership::Document, 'document') }
|
76
|
+
let(:definitions) { { 'REFERENCE' => definition } }
|
77
|
+
|
78
|
+
before do
|
79
|
+
allow(File).to(receive(:rename))
|
80
|
+
end
|
81
|
+
|
82
|
+
context 'when line do not match' do
|
83
|
+
it do
|
84
|
+
expect(modifier.replace_reference('[define---,req,REFERENCE(abcd)]'))
|
85
|
+
.to(eq('[define---,req,REFERENCE(abcd)]'))
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
context 'when definition has not the good type' do
|
90
|
+
it do
|
91
|
+
expect(modifier.replace_reference('[define,req,REFERENCE(abcd)]'))
|
92
|
+
.to(eq('[define,req,REFERENCE(abcd)]'))
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
context 'when definition has the good type' do
|
97
|
+
before do
|
98
|
+
allow(DefMastership::Document).to(receive(:new).and_return(document))
|
99
|
+
allow(document).to(receive(:ref_to_def).with('REFERENCE').and_return(definition))
|
100
|
+
allow(definition).to(receive(:sha256_short).and_return('~abcd1234'))
|
101
|
+
end
|
102
|
+
|
103
|
+
it do
|
104
|
+
expect(modifier.replace_reference('[define,requirement,REFERENCE(abcd)]'))
|
105
|
+
.to(eq('[define,requirement,REFERENCE_something_abcd]'))
|
106
|
+
end
|
107
|
+
|
108
|
+
it do
|
109
|
+
expect(modifier.replace_reference('[define,requirement,REFERENCE(abcd~bad)]'))
|
110
|
+
.to(eq('[define,requirement,REFERENCE_something_abcd]'))
|
111
|
+
end
|
112
|
+
|
113
|
+
it do
|
114
|
+
expect(modifier.replace_reference('// [define,requirement,REFERENCE(abcd~bad)]'))
|
115
|
+
.to(eq('// [define,requirement,REFERENCE(abcd~bad)]'))
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
@@ -1,80 +1,159 @@
|
|
1
1
|
# Copyright (c) 2020 Jerome Arbez-Gindre
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
require('defmastership')
|
4
|
+
require('defmastership/update_def_version_modifier')
|
5
5
|
|
6
6
|
RSpec.describe(DefMastership::UpdateDefVersionModifier) do
|
7
|
-
subject(:modifier)
|
8
|
-
described_class.new(
|
9
|
-
ref_document: 'ref.adoc'
|
10
|
-
)
|
11
|
-
end
|
12
|
-
|
13
|
-
let(:adoc_texts) do
|
14
|
-
{
|
15
|
-
'file1.adoc' => "file1 line1\nfile1 line2",
|
16
|
-
'file2.adoc' => "file2 line1\nfile2 line2"
|
17
|
-
}
|
18
|
-
end
|
7
|
+
subject(:modifier) { described_class.new({}) }
|
19
8
|
|
20
9
|
describe '.new' do
|
10
|
+
it { expect(described_class.ancestors).to(include(DefMastership::Modifier)) }
|
21
11
|
it { is_expected.not_to(be_nil) }
|
22
|
-
it { is_expected.to(have_attributes(
|
23
|
-
it { is_expected.to(have_attributes(
|
12
|
+
it { is_expected.to(have_attributes(def_type: '')) }
|
13
|
+
it { is_expected.to(have_attributes(ref_document: '')) }
|
14
|
+
it { is_expected.to(have_attributes(first_version: '')) }
|
15
|
+
end
|
16
|
+
|
17
|
+
describe '.replacement_methods' do
|
18
|
+
it { expect(described_class.replacement_methods).to(eq(%i[replace_reference])) }
|
24
19
|
end
|
25
20
|
|
26
21
|
describe '#do_modifications' do
|
27
|
-
|
28
|
-
|
29
|
-
|
22
|
+
subject(:modifier) do
|
23
|
+
described_class.new(
|
24
|
+
ref_document: 'ref_doc.adoc',
|
25
|
+
def_type: 'req',
|
26
|
+
first_version: 'a'
|
27
|
+
)
|
28
|
+
end
|
29
|
+
|
30
|
+
let(:document) { instance_double(DefMastership::Document, 'document') }
|
31
|
+
let(:ref_document) { instance_double(DefMastership::Document, 'ref_document') }
|
32
|
+
let(:definition) { instance_double(DefMastership::Definition, 'definition') }
|
33
|
+
let(:ref_definition) { instance_double(DefMastership::Definition, 'ref_definitions') }
|
34
|
+
let(:adoc_sources) do
|
35
|
+
{
|
36
|
+
'file1.adoc' => "[define,req,REFERENCE]\nfile1 line2",
|
37
|
+
'file2.adoc' => "file2 line1\nfile2 line2"
|
38
|
+
}
|
39
|
+
end
|
30
40
|
|
31
41
|
before do
|
32
|
-
allow(DefMastership::
|
33
|
-
|
42
|
+
allow(DefMastership::Document).to(receive(:new).twice.and_return(ref_document, document))
|
43
|
+
allow(document).to(receive(:parse_file_with_preprocessor).with('file1.adoc'))
|
44
|
+
allow(document).to(receive(:parse_file_with_preprocessor).with('file2.adoc'))
|
45
|
+
allow(ref_document).to(receive(:parse_file_with_preprocessor).with('ref_doc.adoc'))
|
46
|
+
allow(document).to(receive(:ref_to_def).with('REFERENCE').and_return(definition))
|
47
|
+
allow(ref_document).to(receive(:ref_to_def).with('REFERENCE').and_return(ref_definition))
|
48
|
+
allow(ref_definition).to(receive(:explicit_version).with(no_args).and_return(nil))
|
49
|
+
allow(definition).to(receive(:sha256_short).with(no_args).and_return('something'))
|
50
|
+
allow(ref_definition).to(receive(:sha256_short).with(no_args).and_return('something_else'))
|
51
|
+
|
52
|
+
modifier.do_modifications(adoc_sources)
|
53
|
+
end
|
54
|
+
|
55
|
+
it { expect(DefMastership::Document).to(have_received(:new).twice) }
|
56
|
+
it { expect(document).to(have_received(:parse_file_with_preprocessor).twice) }
|
57
|
+
it { expect(ref_document).to(have_received(:parse_file_with_preprocessor).with('ref_doc.adoc')) }
|
58
|
+
|
59
|
+
it do
|
60
|
+
expect(modifier.do_modifications(adoc_sources).fetch('file1.adoc')).to(include('REFERENCE(a)'))
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
describe '#replace_reference' do
|
65
|
+
subject(:modifier) do
|
66
|
+
described_class.new(
|
67
|
+
def_type: 'requirement',
|
68
|
+
first_version: 'a'
|
34
69
|
)
|
35
|
-
allow(DefMastership::Document).to(receive(:new).and_return(document, ref_document))
|
36
|
-
allow(document).to(receive(:parse_file_with_preprocessor))
|
37
|
-
allow(ref_document).to(receive(:parse_file_with_preprocessor))
|
38
|
-
allow(line_modifier).to(receive(:'document=').with(document))
|
39
|
-
allow(line_modifier).to(receive(:'ref_document=').with(ref_document))
|
40
|
-
allow(line_modifier).to(receive(:replace).with("file1 line1\n").and_return("new file1 line1\n"))
|
41
|
-
allow(line_modifier).to(receive(:replace).with('file1 line2').and_return('new file1 line2'))
|
42
|
-
allow(line_modifier).to(receive(:replace).with("file2 line1\n").and_return("new file2 line1\n"))
|
43
|
-
allow(line_modifier).to(receive(:replace).with('file2 line2').and_return('new file2 line2'))
|
44
|
-
allow(line_modifier).to(receive(:config).and_return(ref_document: 'ref.adoc'))
|
45
|
-
allow(line_modifier).to(receive(:changes).and_return([%w[from1 to1], %w[from2 to2]]))
|
46
70
|
end
|
47
71
|
|
48
|
-
|
49
|
-
|
72
|
+
let(:document) { instance_double(DefMastership::Document, 'document') }
|
73
|
+
let(:ref_document) { instance_double(DefMastership::Document, 'ref_document') }
|
74
|
+
let(:definition) { instance_double(DefMastership::Definition, 'definition') }
|
75
|
+
let(:ref_definition) { instance_double(DefMastership::Definition, 'ref_definitions') }
|
50
76
|
|
77
|
+
before do
|
78
|
+
allow(File).to(receive(:rename))
|
79
|
+
allow(DefMastership::Document).to(receive(:new).with(no_args).and_return(ref_document, document))
|
80
|
+
end
|
81
|
+
|
82
|
+
context 'when definition has not the good type' do
|
51
83
|
it do
|
52
|
-
expect(
|
53
|
-
|
54
|
-
)
|
84
|
+
expect(modifier.replace_reference('[define,req,REFERENCE]'))
|
85
|
+
.to(eq('[define,req,REFERENCE]'))
|
55
86
|
end
|
56
|
-
|
57
|
-
it { expect(document).to(have_received(:parse_file_with_preprocessor).with('file1.adoc')) }
|
58
|
-
it { expect(document).to(have_received(:parse_file_with_preprocessor).with('file2.adoc')) }
|
59
|
-
it { expect(ref_document).to(have_received(:parse_file_with_preprocessor).with('ref.adoc')) }
|
60
|
-
it { expect(line_modifier).to(have_received(:'document=').with(document)) }
|
61
|
-
it { expect(line_modifier).to(have_received(:'ref_document=').with(ref_document)) }
|
62
|
-
it { expect(line_modifier).to(have_received(:replace).with("file1 line1\n")) }
|
63
|
-
it { expect(line_modifier).to(have_received(:replace).with('file1 line2')) }
|
64
|
-
it { expect(line_modifier).to(have_received(:replace).with("file2 line1\n")) }
|
65
|
-
it { expect(line_modifier).to(have_received(:replace).with('file2 line2')) }
|
66
|
-
it { expect(line_modifier).to(have_received(:config)) }
|
67
|
-
it { expect(line_modifier).to(have_received(:changes)) }
|
68
|
-
it { is_expected.to(have_attributes(config: { ref_document: 'ref.adoc' })) }
|
69
|
-
it { is_expected.to(have_attributes(changes: [%w[from1 to1], %w[from2 to2]])) }
|
70
87
|
end
|
71
88
|
|
72
|
-
|
73
|
-
|
74
|
-
'
|
75
|
-
|
76
|
-
|
77
|
-
|
89
|
+
context 'when definition has the good type' do
|
90
|
+
before do
|
91
|
+
allow(document).to(receive(:ref_to_def).with('REFERENCE').and_return(definition))
|
92
|
+
allow(definition).to(receive(:sha256_short).and_return('~abcd1234'))
|
93
|
+
end
|
94
|
+
|
95
|
+
context 'when definition has NOT changed' do
|
96
|
+
before do
|
97
|
+
allow(ref_document).to(receive(:ref_to_def).with('REFERENCE').and_return(ref_definition))
|
98
|
+
allow(ref_definition).to(receive(:sha256_short).and_return('~abcd1234'))
|
99
|
+
end
|
100
|
+
|
101
|
+
it do
|
102
|
+
allow(ref_definition).to(receive(:explicit_version).and_return(nil))
|
103
|
+
expect(modifier.replace_reference('[define,requirement,REFERENCE]'))
|
104
|
+
.to(eq('[define,requirement,REFERENCE]'))
|
105
|
+
end
|
106
|
+
|
107
|
+
it do
|
108
|
+
allow(ref_definition).to(receive(:explicit_version).and_return('c'))
|
109
|
+
expect(modifier.replace_reference('[define,requirement,REFERENCE]'))
|
110
|
+
.to(eq('[define,requirement,REFERENCE(c)]'))
|
111
|
+
end
|
112
|
+
|
113
|
+
it do
|
114
|
+
allow(ref_definition).to(receive(:explicit_version).and_return('c'))
|
115
|
+
expect(modifier.replace_reference('[define,requirement,REFERENCE(tyty~1234)]'))
|
116
|
+
.to(eq('[define,requirement,REFERENCE(c~1234)]'))
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
context 'when definition has changed' do
|
121
|
+
before do
|
122
|
+
allow(ref_document).to(receive(:ref_to_def).with('REFERENCE').and_return(ref_definition))
|
123
|
+
allow(ref_definition).to(receive(:sha256_short).and_return('~4321aaaa'))
|
124
|
+
end
|
125
|
+
|
126
|
+
[
|
127
|
+
[nil, '', '(a)'],
|
128
|
+
['c', '', '(d)'],
|
129
|
+
['c', '(tyty~1234)', '(d~1234)'],
|
130
|
+
['2', '', '(3)'],
|
131
|
+
['1222', '', '(1223)'],
|
132
|
+
['abb', '', '(abc)']
|
133
|
+
].each do |ref, from, to|
|
134
|
+
it do
|
135
|
+
allow(ref_definition).to(receive(:explicit_version).and_return(ref))
|
136
|
+
expect(modifier.replace_reference("[define,requirement,REFERENCE#{from}]"))
|
137
|
+
.to(eq("[define,requirement,REFERENCE#{to}]"))
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
context 'when definition is new' do
|
143
|
+
before do
|
144
|
+
allow(ref_document).to(receive(:ref_to_def).with('REFERENCE').and_return(nil))
|
145
|
+
end
|
146
|
+
|
147
|
+
it do
|
148
|
+
expect(modifier.replace_reference('[define,requirement,REFERENCE(whatever)]'))
|
149
|
+
.to(eq('[define,requirement,REFERENCE]'))
|
150
|
+
end
|
151
|
+
|
152
|
+
it do
|
153
|
+
expect(modifier.replace_reference('[define,requirement,REFERENCE(~1234)]'))
|
154
|
+
.to(eq('[define,requirement,REFERENCE(~1234)]'))
|
155
|
+
end
|
156
|
+
end
|
78
157
|
end
|
79
158
|
end
|
80
159
|
end
|
data/tasks/console.rake
ADDED
data/tasks/package.task
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# Copyright (c) 2023 Jerome Arbez-Gindre
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
namespace 'quality' do
|
5
|
+
begin
|
6
|
+
require('rubocop/rake_task')
|
7
|
+
|
8
|
+
RuboCop::RakeTask.new do |task|
|
9
|
+
task.options << '--display-cop-names'
|
10
|
+
end
|
11
|
+
rescue LoadError
|
12
|
+
task(:rubocop) do
|
13
|
+
puts('Install rubocop to run its rake tasks')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
begin
|
18
|
+
require('reek/rake/task')
|
19
|
+
|
20
|
+
Reek::Rake::Task.new do |t|
|
21
|
+
t.fail_on_error = true
|
22
|
+
t.verbose = false
|
23
|
+
end
|
24
|
+
rescue LoadError
|
25
|
+
task(:reek) do
|
26
|
+
puts('Install reek to run its rake tasks')
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
desc 'Runs all quality code check'
|
31
|
+
task(all: ['quality:rubocop', 'quality:reek'])
|
32
|
+
end
|
33
|
+
|
34
|
+
desc 'Synonym for quality:rubocop'
|
35
|
+
task(rubocop: 'quality:rubocop')
|
36
|
+
|
37
|
+
desc 'Synonym for quality:reek'
|
38
|
+
task(reek: 'quality:reek')
|
data/tasks/test.rake
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Copyright (c) 2023 Jerome Arbez-Gindre
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require('cucumber/rake/task')
|
5
|
+
require('rspec/core/rake_task')
|
6
|
+
|
7
|
+
namespace 'test' do
|
8
|
+
RSpec::Core::RakeTask.new(:spec)
|
9
|
+
|
10
|
+
cuke_results = 'features_results.html'
|
11
|
+
CLEAN << cuke_results
|
12
|
+
|
13
|
+
Cucumber::Rake::Task.new(:features) do |t|
|
14
|
+
opts = ['features'] +
|
15
|
+
['--format', 'html'] +
|
16
|
+
['-o', cuke_results] +
|
17
|
+
['--format', 'progress'] +
|
18
|
+
['-x']
|
19
|
+
|
20
|
+
opts += ['--tags', ENV.fetch('TAGS').split.join(' or ')] if ENV['TAGS']
|
21
|
+
t.cucumber_opts = opts
|
22
|
+
end
|
23
|
+
|
24
|
+
Cucumber::Rake::Task.new('features:wip') do |t|
|
25
|
+
t.cucumber_opts = ['features'] +
|
26
|
+
['--format', 'html'] +
|
27
|
+
['-o', cuke_results] +
|
28
|
+
['--format', 'pretty'] +
|
29
|
+
['-x'] +
|
30
|
+
['-s'] +
|
31
|
+
['--tags', '@wip and not @pending']
|
32
|
+
end
|
33
|
+
|
34
|
+
desc 'Runs all unit tests and acceptance tests'
|
35
|
+
task(all: ['test:spec', 'test:features'])
|
36
|
+
end
|
37
|
+
|
38
|
+
desc 'Synonym for test:spec'
|
39
|
+
task(spec: 'test:spec')
|
40
|
+
|
41
|
+
desc 'Synonym for test:all'
|
42
|
+
task(test: 'test:all')
|
43
|
+
|
44
|
+
desc('Test all features')
|
45
|
+
task(cucumber: 'test:features')
|
metadata
CHANGED
@@ -1,155 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: defmastership
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jérôme Arbez-Gindre
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: aruba
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '2'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '2'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: cucumber
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '8'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '8'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rake
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '13'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '13'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rdoc
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '6'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '6'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rspec
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '3'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '3'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rubocop
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - '='
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '1.50'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - '='
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '1.50'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rubocop-performance
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '1.17'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '1.17'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rubocop-rake
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0.6'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0.6'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: rubocop-rspec
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '2.22'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '2.22'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: simplecov
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - "~>"
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - "~>"
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0'
|
153
13
|
- !ruby/object:Gem::Dependency
|
154
14
|
name: aasm
|
155
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -231,7 +91,6 @@ files:
|
|
231
91
|
- features/support/env.rb
|
232
92
|
- lib/defmastership.rb
|
233
93
|
- lib/defmastership/batch_modifier.rb
|
234
|
-
- lib/defmastership/change_ref_line_modifier.rb
|
235
94
|
- lib/defmastership/change_ref_modifier.rb
|
236
95
|
- lib/defmastership/comment_filter.rb
|
237
96
|
- lib/defmastership/constants.rb
|
@@ -242,19 +101,18 @@ files:
|
|
242
101
|
- lib/defmastership/definition_parser.rb
|
243
102
|
- lib/defmastership/document.rb
|
244
103
|
- lib/defmastership/filters.rb
|
245
|
-
- lib/defmastership/
|
246
|
-
- lib/defmastership/
|
104
|
+
- lib/defmastership/matching_line.rb
|
105
|
+
- lib/defmastership/modifier.rb
|
106
|
+
- lib/defmastership/modifier_factory.rb
|
247
107
|
- lib/defmastership/parsing_state.rb
|
248
|
-
- lib/defmastership/rename_included_files_line_modifier.rb
|
249
108
|
- lib/defmastership/rename_included_files_modifier.rb
|
250
|
-
- lib/defmastership/
|
109
|
+
- lib/defmastership/set_join_hack.rb
|
251
110
|
- lib/defmastership/update_def_checksum_modifier.rb
|
252
|
-
- lib/defmastership/
|
111
|
+
- lib/defmastership/update_def_modifier.rb
|
253
112
|
- lib/defmastership/update_def_version_modifier.rb
|
254
113
|
- lib/defmastership/version.rb
|
255
114
|
- spec/spec_helper.rb
|
256
115
|
- spec/unit/def_mastership/batch_modifier_spec.rb
|
257
|
-
- spec/unit/def_mastership/change_ref_line_modifier_spec.rb
|
258
116
|
- spec/unit/def_mastership/change_ref_modifier_spec.rb
|
259
117
|
- spec/unit/def_mastership/csv_formatter_body_spec.rb
|
260
118
|
- spec/unit/def_mastership/csv_formatter_header_spec.rb
|
@@ -262,15 +120,20 @@ files:
|
|
262
120
|
- spec/unit/def_mastership/definition_parser_spec.rb
|
263
121
|
- spec/unit/def_mastership/definition_spec.rb
|
264
122
|
- spec/unit/def_mastership/document_spec.rb
|
123
|
+
- spec/unit/def_mastership/matching_line_spec.rb
|
124
|
+
- spec/unit/def_mastership/modifier_factory_spec.rb
|
125
|
+
- spec/unit/def_mastership/modifier_spec.rb
|
265
126
|
- spec/unit/def_mastership/parsing_state_spec.rb
|
266
|
-
- spec/unit/def_mastership/rename_included_files_line_modifier_spec.rb
|
267
127
|
- spec/unit/def_mastership/rename_included_files_modifier_spec.rb
|
268
128
|
- spec/unit/def_mastership/string_spec.rb
|
269
|
-
- spec/unit/def_mastership/update_def_checksum_line_modifier_spec.rb
|
270
129
|
- spec/unit/def_mastership/update_def_checksum_modifier_spec.rb
|
271
|
-
- spec/unit/def_mastership/
|
130
|
+
- spec/unit/def_mastership/update_def_modifier_spec.rb
|
272
131
|
- spec/unit/def_mastership/update_def_version_modifier_spec.rb
|
273
132
|
- spec/unit/def_mastership_spec.rb
|
133
|
+
- tasks/console.rake
|
134
|
+
- tasks/package.task
|
135
|
+
- tasks/smelling_code.rake
|
136
|
+
- tasks/test.rake
|
274
137
|
homepage: https://gitlab.com/jjag/defmastership/
|
275
138
|
licenses:
|
276
139
|
- MIT
|
@@ -295,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
295
158
|
- !ruby/object:Gem::Version
|
296
159
|
version: '0'
|
297
160
|
requirements: []
|
298
|
-
rubygems_version: 3.
|
161
|
+
rubygems_version: 3.5.6
|
299
162
|
signing_key:
|
300
163
|
specification_version: 4
|
301
164
|
summary: Handling of references and definitions with asciidoctor
|