defmastership 1.0.16 → 1.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.gitlab-ci.yml +34 -3
- data/.rubocop.yml +14 -6
- data/Rakefile +29 -15
- data/bin/defmastership +4 -4
- data/defmastership.gemspec +32 -27
- data/lib/defmastership/batch_modifier.rb +1 -1
- data/lib/defmastership/change_ref_line_modifier.rb +3 -0
- data/lib/defmastership/change_ref_modifier.rb +2 -0
- data/lib/defmastership/csv_formatter.rb +4 -4
- data/lib/defmastership/modifier_base.rb +10 -3
- data/lib/defmastership/version.rb +1 -1
- data/lib/defmastership.rb +11 -16
- data/spec/spec_helper.rb +2 -2
- data/spec/unit/{defmastership → def_mastership}/batch_modifier_spec.rb +5 -4
- data/spec/unit/{defmastership → def_mastership}/change_ref_line_modifier_spec.rb +11 -4
- data/spec/unit/{defmastership → def_mastership}/change_ref_modifier_spec.rb +1 -1
- data/spec/unit/{defmastership → def_mastership}/csv_formatter_body_spec.rb +1 -1
- data/spec/unit/{defmastership → def_mastership}/csv_formatter_header_spec.rb +1 -1
- data/spec/unit/{defmastership → def_mastership}/csv_formatter_spec.rb +11 -8
- data/spec/unit/{defmastership → def_mastership}/definition_parser_spec.rb +1 -1
- data/spec/unit/{defmastership → def_mastership}/definition_spec.rb +1 -1
- data/spec/unit/{defmastership → def_mastership}/document_spec.rb +56 -44
- data/spec/unit/{defmastership → def_mastership}/parsing_state_spec.rb +15 -15
- data/spec/unit/{defmastership → def_mastership}/rename_included_files_line_modifier_spec.rb +7 -3
- data/spec/unit/{defmastership → def_mastership}/rename_included_files_modifier_spec.rb +1 -1
- data/spec/unit/{defmastership → def_mastership}/update_def_checksum_line_modifier_spec.rb +7 -3
- data/spec/unit/{defmastership → def_mastership}/update_def_checksum_modifier_spec.rb +1 -1
- data/spec/unit/{defmastership → def_mastership}/update_def_version_line_modifier_spec.rb +7 -3
- data/spec/unit/{defmastership → def_mastership}/update_def_version_modifier_spec.rb +3 -3
- data/spec/unit/{defmastership_spec.rb → def_mastership_spec.rb} +1 -1
- metadata +64 -35
- /data/spec/unit/{defmastership/comment_filter_spec.rb → def_mastership/string_spec.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29225577d47450033d4ea2c9715ab51cb2025318ff26da38435c11900ff0cb52
|
4
|
+
data.tar.gz: a36cb1eb3b8c45cb14b74200d43163edd1907bcfe7ed2a54d15f4f1ebd341454
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb97db7204c4665f53c5f57e03737e31a88373a928ce4157f912938b84feff1b3b7f260365fa210bab905b47eb87c336e259e91d1a77d73ace80e84f8152d464
|
7
|
+
data.tar.gz: 4c359dbf1017c365d9c00faf7617233e3793093dba327d39982cebd7dabd68a7b5af0a999568c91775cd16a2a8af9cc544a67fdf3acedf92d65120269c372d18
|
data/.gitignore
CHANGED
data/.gitlab-ci.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
default:
|
2
|
-
image: ruby:2
|
2
|
+
image: ruby:3.2
|
3
3
|
before_script:
|
4
4
|
- apt-get update
|
5
5
|
- ruby -v
|
@@ -7,14 +7,45 @@ default:
|
|
7
7
|
- gem install bundler --no-document
|
8
8
|
- bundle install --jobs $(nproc) "${FLAGS[@]}"
|
9
9
|
|
10
|
-
|
10
|
+
bdd:
|
11
11
|
script:
|
12
12
|
- bundle exec rake features
|
13
13
|
|
14
|
-
|
14
|
+
unit tests:
|
15
15
|
script:
|
16
16
|
- bundle exec rake spec
|
17
17
|
|
18
18
|
rubocop:
|
19
19
|
script:
|
20
20
|
- bundle exec rake rubocop
|
21
|
+
|
22
|
+
bdd ruby2.7:
|
23
|
+
image: ruby:2.7
|
24
|
+
script:
|
25
|
+
- bundle exec rake features
|
26
|
+
|
27
|
+
bdd ruby3.0:
|
28
|
+
image: ruby:3.0
|
29
|
+
script:
|
30
|
+
- bundle exec rake features
|
31
|
+
|
32
|
+
bdd ruby3.1:
|
33
|
+
image: ruby:3.1
|
34
|
+
script:
|
35
|
+
- bundle exec rake features
|
36
|
+
|
37
|
+
unit tests ruby2.7:
|
38
|
+
image: ruby:2.7
|
39
|
+
script:
|
40
|
+
- bundle exec rake spec
|
41
|
+
|
42
|
+
unit tests ruby3.0:
|
43
|
+
image: ruby:3.0
|
44
|
+
script:
|
45
|
+
- bundle exec rake spec
|
46
|
+
|
47
|
+
unit tests ruby3.1:
|
48
|
+
image: ruby:3.1
|
49
|
+
script:
|
50
|
+
- bundle exec rake spec
|
51
|
+
|
data/.rubocop.yml
CHANGED
@@ -10,17 +10,19 @@
|
|
10
10
|
# See https://github.com/rubocop-hq/rubocop/blob/master/manual/configuration.md
|
11
11
|
|
12
12
|
require:
|
13
|
+
- rubocop-performance
|
13
14
|
- rubocop-rspec
|
15
|
+
- rubocop-rake
|
14
16
|
|
15
17
|
AllCops:
|
16
|
-
TargetRubyVersion: 2.
|
18
|
+
TargetRubyVersion: 2.7
|
17
19
|
EnabledByDefault: true
|
18
20
|
DisplayCopNames: true
|
19
21
|
|
20
22
|
Style/Copyright:
|
21
23
|
Enabled: true
|
22
24
|
Notice: 'Copyright (\(c\) )?202[0-9] Jerome Arbez-Gindre'
|
23
|
-
AutocorrectNotice: '# Copyright (c)
|
25
|
+
AutocorrectNotice: '# Copyright (c) 2023 Jerome Arbez-Gindre'
|
24
26
|
|
25
27
|
Lint/ConstantResolution: # Not available ins rubocop 0.81
|
26
28
|
Enabled: false
|
@@ -29,7 +31,10 @@ Style/DocumentationMethod:
|
|
29
31
|
Enabled: false
|
30
32
|
|
31
33
|
Style/StringHashKeys :
|
32
|
-
Enabled:
|
34
|
+
Enabled: true
|
35
|
+
Exclude:
|
36
|
+
- '*.gemspec'
|
37
|
+
- 'spec/**/*'
|
33
38
|
|
34
39
|
Style/MissingElse:
|
35
40
|
EnforcedStyle: case
|
@@ -55,14 +60,17 @@ Style/ConstantVisibility :
|
|
55
60
|
|
56
61
|
# rubocop-rspec options
|
57
62
|
RSpec/MessageExpectation :
|
58
|
-
Enabled:
|
63
|
+
Enabled: true
|
59
64
|
|
60
65
|
RSpec/FilePath :
|
61
|
-
Enabled:
|
66
|
+
Enabled: true
|
62
67
|
|
63
68
|
RSpec/NestedGroups:
|
64
69
|
Max: 4
|
65
70
|
|
66
71
|
Layout/RedundantLineBreak:
|
67
72
|
Enabled: false
|
68
|
-
|
73
|
+
|
74
|
+
Layout/EndOfLine:
|
75
|
+
EnforcedStyle: lf
|
76
|
+
|
data/Rakefile
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# Copyright (c) 2020 Jerome Arbez-Gindre
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
+
require('cucumber')
|
5
|
+
require('cucumber/rake/task')
|
4
6
|
require('rake/clean')
|
7
|
+
require('rdoc/task')
|
5
8
|
require('rubygems')
|
6
9
|
require('rubygems/package_task')
|
7
|
-
require('rdoc/task')
|
8
|
-
require('cucumber')
|
9
|
-
require('cucumber/rake/task')
|
10
10
|
|
11
11
|
Rake::RDocTask.new do |rd|
|
12
12
|
rd.main = 'README.rdoc'
|
@@ -14,40 +14,54 @@ Rake::RDocTask.new do |rd|
|
|
14
14
|
rd.title = 'Your application title'
|
15
15
|
end
|
16
16
|
|
17
|
-
spec = eval(
|
17
|
+
spec = eval(File.read('defmastership.gemspec'))
|
18
18
|
|
19
19
|
Gem::PackageTask.new(spec)
|
20
20
|
CUKE_RESULTS = 'features_results.html'
|
21
21
|
CLEAN << CUKE_RESULTS
|
22
22
|
|
23
23
|
desc('Run features')
|
24
|
-
|
25
|
-
opts =
|
26
|
-
|
24
|
+
Cucumber::Rake::Task.new(:features) do |t|
|
25
|
+
opts = ['features'] +
|
26
|
+
['--format', 'html'] +
|
27
|
+
['-o', CUKE_RESULTS] +
|
28
|
+
['--format', 'progress'] +
|
29
|
+
['-x']
|
30
|
+
opts += ['--tags', ENV.fetch('TAGS').split.join(' or ')] if ENV['TAGS']
|
27
31
|
t.cucumber_opts = opts
|
28
32
|
t.fork = false
|
29
33
|
end
|
30
34
|
|
31
35
|
desc('Run features tagged as work-in-progress (@wip)')
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
36
|
+
Cucumber::Rake::Task.new('features:wip') do |t|
|
37
|
+
t.cucumber_opts = ['features'] +
|
38
|
+
['--format', 'html'] +
|
39
|
+
['-o', CUKE_RESULTS] +
|
40
|
+
['--format', 'pretty'] +
|
41
|
+
['-x'] +
|
42
|
+
['-s'] +
|
43
|
+
['--tags', '@wip and not @pending']
|
37
44
|
t.fork = false
|
38
45
|
end
|
39
46
|
|
47
|
+
desc('Test all features')
|
40
48
|
task(cucumber: :features)
|
49
|
+
|
50
|
+
desc('Test only WIP features')
|
41
51
|
task(wip: 'features:wip')
|
42
52
|
|
43
53
|
require('bundler/gem_tasks')
|
44
54
|
|
45
55
|
require('rspec/core/rake_task')
|
46
56
|
|
47
|
-
|
57
|
+
RSpec::Core::RakeTask.new(:spec)
|
48
58
|
|
49
59
|
require('rubocop/rake_task')
|
50
60
|
|
51
|
-
|
61
|
+
RuboCop::RakeTask.new do |task|
|
62
|
+
task.requires << 'rubocop-performance'
|
63
|
+
task.requires << 'rubocop-rspec'
|
64
|
+
task.requires << 'rubocop-rake'
|
65
|
+
end
|
52
66
|
|
53
|
-
task(default: %i[spec features
|
67
|
+
task(default: %i[rubocop spec features])
|
data/bin/defmastership
CHANGED
@@ -67,7 +67,7 @@ module DefMastership
|
|
67
67
|
|
68
68
|
warn("warning: #{definition.reference} has a wrong explicit checksum (should be #{definition.sha256})")
|
69
69
|
end
|
70
|
-
exit 1 unless options[:
|
70
|
+
exit 1 unless options[:'no-fail']
|
71
71
|
end
|
72
72
|
end
|
73
73
|
end
|
@@ -87,16 +87,16 @@ module DefMastership
|
|
87
87
|
c.action do |_global_options, options, args|
|
88
88
|
changer = BatchModifier.new(
|
89
89
|
YAML.load_file(options[:'modifications-file']),
|
90
|
-
args.
|
90
|
+
args.to_h { |afile| [afile, File.read(afile)] }
|
91
91
|
)
|
92
92
|
|
93
93
|
changer.apply(options[:modifications])
|
94
94
|
|
95
95
|
changer.adoc_texts.each do |adoc_file, adoc_text|
|
96
|
-
File.
|
96
|
+
File.write(adoc_file, adoc_text)
|
97
97
|
end
|
98
98
|
|
99
|
-
File.
|
99
|
+
File.write(options[:'modifications-file'], changer.config.to_yaml)
|
100
100
|
|
101
101
|
unless options['changes-summary'].nil?
|
102
102
|
CSV.open(options['changes-summary'], 'wb') do |csv|
|
data/defmastership.gemspec
CHANGED
@@ -14,31 +14,36 @@ require(
|
|
14
14
|
)
|
15
15
|
)
|
16
16
|
|
17
|
-
Gem::Specification.new do |
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
17
|
+
Gem::Specification.new do |spec|
|
18
|
+
spec.metadata = {
|
19
|
+
'rubygems_mfa_required' => 'true'
|
20
|
+
}
|
21
|
+
spec.required_ruby_version = '>= 2.7'
|
22
|
+
spec.name = 'defmastership'
|
23
|
+
spec.version = DefMastership::VERSION
|
24
|
+
spec.author = 'Jérôme Arbez-Gindre'
|
25
|
+
spec.email = 'jeromearbezgindre@gmail.com'
|
26
|
+
spec.licenses = ['MIT']
|
27
|
+
spec.homepage = 'https://gitlab.com/jjag/defmastership/'
|
28
|
+
spec.platform = Gem::Platform::RUBY
|
29
|
+
spec.summary = 'Handling of references and definitions with asciidoctor'
|
30
|
+
spec.files = `git ls-files`.split("\n")
|
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
|
+
spec.bindir = 'bin'
|
35
|
+
spec.executables << 'defmastership'
|
36
|
+
spec.add_development_dependency('aruba', '~> 2')
|
37
|
+
spec.add_development_dependency('cucumber', '~> 8')
|
38
|
+
spec.add_development_dependency('rake', '~> 13')
|
39
|
+
spec.add_development_dependency('rdoc', '~> 6')
|
40
|
+
spec.add_development_dependency('rspec', '~> 3')
|
41
|
+
spec.add_development_dependency('rubocop', '1.50')
|
42
|
+
spec.add_development_dependency('rubocop-performance', '~> 1.17')
|
43
|
+
spec.add_development_dependency('rubocop-rake', '~> 0.6')
|
44
|
+
spec.add_development_dependency('rubocop-rspec', '~> 2.22')
|
45
|
+
spec.add_development_dependency('simplecov', '~> 0')
|
46
|
+
spec.add_runtime_dependency('aasm', '~> 5')
|
47
|
+
spec.add_runtime_dependency('asciidoctor', '~> 2')
|
48
|
+
spec.add_runtime_dependency('gli', '~> 2')
|
44
49
|
end
|
@@ -1,6 +1,9 @@
|
|
1
1
|
# Copyright (c) 2020 Jerome Arbez-Gindre
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
+
require 'defmastership/constants'
|
5
|
+
require 'defmastership/line_modifier_base'
|
6
|
+
|
4
7
|
module DefMastership
|
5
8
|
# Change references from temporary to definitive with multiple RefChangers
|
6
9
|
class ChangeRefLineModifier < LineModifierBase
|
@@ -2,8 +2,8 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require('csv')
|
5
|
-
require('defmastership/csv_formatter_header')
|
6
5
|
require('defmastership/csv_formatter_body')
|
6
|
+
require('defmastership/csv_formatter_header')
|
7
7
|
|
8
8
|
module DefMastership
|
9
9
|
# to export a CSV file
|
@@ -15,7 +15,7 @@ module DefMastership
|
|
15
15
|
|
16
16
|
def export_to(output_file)
|
17
17
|
column_list = build_column_list
|
18
|
-
CSV.open(output_file, 'w:ISO-8859-1',
|
18
|
+
CSV.open(output_file, 'w:ISO-8859-1', col_sep: @sep) do |csv|
|
19
19
|
csv << header(column_list)
|
20
20
|
@doc.definitions.each { |definition| csv << body(definition, column_list) }
|
21
21
|
end
|
@@ -26,13 +26,13 @@ module DefMastership
|
|
26
26
|
def header(column_list)
|
27
27
|
header_formatter = CSVFormatterHeader.new(@doc)
|
28
28
|
header_line = column_list.map { |part| header_formatter.public_send(part) }
|
29
|
-
header_line.
|
29
|
+
header_line.flatten
|
30
30
|
end
|
31
31
|
|
32
32
|
def body(definition, column_list)
|
33
33
|
body_formatter = CSVFormatterBody.new(@doc)
|
34
34
|
body_line = column_list.map { |part| body_formatter.public_send(part, definition) }
|
35
|
-
body_line.
|
35
|
+
body_line.flatten
|
36
36
|
end
|
37
37
|
|
38
38
|
def build_column_list
|
@@ -16,14 +16,21 @@ module DefMastership
|
|
16
16
|
|
17
17
|
adoc_texts =
|
18
18
|
replacements.reduce(adoc_texts) do |texts, method|
|
19
|
-
texts
|
20
|
-
text.lines.map { |line| line_modifier.public_send(method, line) }.join
|
21
|
-
end
|
19
|
+
transform_values(texts, line_modifier, method)
|
22
20
|
end
|
23
21
|
|
24
22
|
@config = line_modifier.config
|
25
23
|
@changes = line_modifier.changes
|
26
24
|
adoc_texts
|
27
25
|
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def transform_values(texts, line_modifier, method)
|
30
|
+
texts.transform_values do |text|
|
31
|
+
text.lines.map { |line| line_modifier.public_send(method, line) }
|
32
|
+
.join
|
33
|
+
end
|
34
|
+
end
|
28
35
|
end
|
29
36
|
end
|
data/lib/defmastership.rb
CHANGED
@@ -5,27 +5,22 @@ require('defmastership/version')
|
|
5
5
|
|
6
6
|
# Add requires for other files you add to your project here, so
|
7
7
|
# you just need to require this one file in your bin file
|
8
|
+
require('defmastership/batch_modifier')
|
9
|
+
require('defmastership/change_ref_line_modifier')
|
10
|
+
require('defmastership/change_ref_modifier')
|
11
|
+
require('defmastership/comment_filter')
|
8
12
|
require('defmastership/constants')
|
9
|
-
require('defmastership/
|
13
|
+
require('defmastership/csv_formatter')
|
10
14
|
require('defmastership/definition')
|
11
15
|
require('defmastership/definition_parser')
|
12
|
-
require('defmastership/filters')
|
13
16
|
require('defmastership/document')
|
14
|
-
require('defmastership/
|
15
|
-
require('defmastership/csv_formatter')
|
16
|
-
|
17
|
-
require('defmastership/modifier_base')
|
17
|
+
require('defmastership/filters')
|
18
18
|
require('defmastership/line_modifier_base')
|
19
|
-
require('defmastership/
|
20
|
-
|
21
|
-
require('defmastership/change_ref_modifier')
|
22
|
-
require('defmastership/change_ref_line_modifier')
|
23
|
-
|
24
|
-
require('defmastership/rename_included_files_modifier')
|
19
|
+
require('defmastership/modifier_base')
|
20
|
+
require('defmastership/parsing_state')
|
25
21
|
require('defmastership/rename_included_files_line_modifier')
|
26
|
-
|
27
|
-
require('defmastership/update_def_checksum_modifier')
|
22
|
+
require('defmastership/rename_included_files_modifier')
|
28
23
|
require('defmastership/update_def_checksum_line_modifier')
|
29
|
-
|
30
|
-
require('defmastership/update_def_version_modifier')
|
24
|
+
require('defmastership/update_def_checksum_modifier')
|
31
25
|
require('defmastership/update_def_version_line_modifier')
|
26
|
+
require('defmastership/update_def_version_modifier')
|
data/spec/spec_helper.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# Copyright (c) 2020 Jerome Arbez-Gindre
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
require('bundler/setup')
|
5
|
-
require('aruba/rspec')
|
6
4
|
require('aasm/rspec')
|
5
|
+
require('aruba/rspec')
|
6
|
+
require('bundler/setup')
|
7
7
|
|
8
8
|
# formatter = [SimpleCov::Formatter::HTMLFormatter]
|
9
9
|
# SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(formatter)
|
@@ -31,7 +31,7 @@ RSpec.describe(DefMastership::BatchModifier) do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
describe '.new' do
|
34
|
-
it { is_expected.not_to(
|
34
|
+
it { is_expected.not_to(be_nil) }
|
35
35
|
it { is_expected.to(have_attributes(config: config)) }
|
36
36
|
|
37
37
|
it do
|
@@ -114,9 +114,10 @@ RSpec.describe(DefMastership::BatchModifier) do
|
|
114
114
|
|
115
115
|
context 'with wrong modification' do
|
116
116
|
it do
|
117
|
-
expect { batchmodifier.apply('wrong-modification') }
|
118
|
-
|
119
|
-
|
117
|
+
expect { batchmodifier.apply('wrong-modification') }
|
118
|
+
.to(
|
119
|
+
raise_error(ArgumentError, 'wrong-modification is not a known modification')
|
120
|
+
)
|
120
121
|
end
|
121
122
|
end
|
122
123
|
end
|
@@ -7,12 +7,16 @@ RSpec.describe(DefMastership::ChangeRefLineModifier) do
|
|
7
7
|
subject(:refchanger) { described_class.new }
|
8
8
|
|
9
9
|
describe '.new' do
|
10
|
-
it { is_expected.not_to(
|
10
|
+
it { is_expected.not_to(be_nil) }
|
11
11
|
it { is_expected.to(have_attributes(from_regexp: '')) }
|
12
12
|
it { is_expected.to(have_attributes(to_template: '')) }
|
13
13
|
it { is_expected.to(have_attributes(next_ref: 0)) }
|
14
14
|
it { is_expected.to(have_attributes(changes: [])) }
|
15
|
-
|
15
|
+
|
16
|
+
it do
|
17
|
+
expect { refchanger.user_defined_attribute }
|
18
|
+
.to(raise_error(NoMethodError))
|
19
|
+
end
|
16
20
|
end
|
17
21
|
|
18
22
|
describe '.from_config' do
|
@@ -24,7 +28,7 @@ RSpec.describe(DefMastership::ChangeRefLineModifier) do
|
|
24
28
|
)
|
25
29
|
end
|
26
30
|
|
27
|
-
it { is_expected.not_to(
|
31
|
+
it { is_expected.not_to(be_nil) }
|
28
32
|
it { is_expected.to(have_attributes(from_regexp: 'Whatever.+')) }
|
29
33
|
it { is_expected.to(have_attributes(to_template: 'Whatever')) }
|
30
34
|
it { is_expected.to(have_attributes(next_ref: 17)) }
|
@@ -238,6 +242,9 @@ RSpec.describe(DefMastership::ChangeRefLineModifier) do
|
|
238
242
|
.to(eq('defs:iref[TUTU]'))
|
239
243
|
end
|
240
244
|
|
241
|
-
it
|
245
|
+
it do
|
246
|
+
expect { refchanger.replace(:pouet, 'whatever') }
|
247
|
+
.to(raise_error(NoMethodError))
|
248
|
+
end
|
242
249
|
end
|
243
250
|
end
|
@@ -18,7 +18,7 @@ RSpec.describe(DefMastership::ChangeRefModifier) do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
describe '.new' do
|
21
|
-
it { is_expected.not_to(
|
21
|
+
it { is_expected.not_to(be_nil) }
|
22
22
|
it { is_expected.to(have_attributes(config: 'fake config')) }
|
23
23
|
it { is_expected.to(have_attributes(changes: [])) }
|
24
24
|
end
|
@@ -10,7 +10,7 @@ RSpec.describe(DefMastership::CSVFormatterBody) do
|
|
10
10
|
let(:definition) { instance_double(DefMastership::Definition, 'definition') }
|
11
11
|
|
12
12
|
describe '.new' do
|
13
|
-
it { is_expected.not_to(
|
13
|
+
it { is_expected.not_to(be_nil) }
|
14
14
|
end
|
15
15
|
|
16
16
|
describe '#fixed' do
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# Copyright (c) 2020 Jerome Arbez-Gindre
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
+
require('csv')
|
4
5
|
require('defmastership')
|
5
6
|
require('ostruct')
|
6
|
-
require('csv')
|
7
7
|
|
8
8
|
RSpec.describe(DefMastership::CSVFormatter) do
|
9
9
|
subject(:formatter) { described_class.new(document, ';') }
|
@@ -11,7 +11,7 @@ RSpec.describe(DefMastership::CSVFormatter) do
|
|
11
11
|
let(:document) { instance_double(DefMastership::Document, 'document') }
|
12
12
|
|
13
13
|
describe '.new' do
|
14
|
-
it { is_expected.not_to(
|
14
|
+
it { is_expected.not_to(be_nil) }
|
15
15
|
end
|
16
16
|
|
17
17
|
describe '#export_to' do
|
@@ -232,12 +232,7 @@ RSpec.describe(DefMastership::CSVFormatter) do
|
|
232
232
|
|
233
233
|
context 'when #export_to csv file' do
|
234
234
|
let(:target_file) { 'export.csv' }
|
235
|
-
let(:definitions)
|
236
|
-
[
|
237
|
-
OpenStruct.new(type: 'a', reference: 'b', value: 'c', sha256: 'd'),
|
238
|
-
OpenStruct.new(type: 'd', reference: 'e', value: 'f', sha256: 'g')
|
239
|
-
]
|
240
|
-
end
|
235
|
+
let(:definitions) { [double, double] }
|
241
236
|
|
242
237
|
before do
|
243
238
|
setup_aruba
|
@@ -246,6 +241,14 @@ RSpec.describe(DefMastership::CSVFormatter) do
|
|
246
241
|
allow(document).to(receive(:iref).with(no_args).and_return(false))
|
247
242
|
allow(document).to(receive(:attributes).with(no_args).and_return({}))
|
248
243
|
allow(document).to(receive(:definitions).with(no_args).and_return(definitions))
|
244
|
+
allow(definitions[0]).to(receive(:type).and_return('a'))
|
245
|
+
allow(definitions[0]).to(receive(:reference).and_return('b'))
|
246
|
+
allow(definitions[0]).to(receive(:value).and_return('c'))
|
247
|
+
allow(definitions[0]).to(receive(:sha256).and_return('d'))
|
248
|
+
allow(definitions[1]).to(receive(:type).and_return('d'))
|
249
|
+
allow(definitions[1]).to(receive(:reference).and_return('e'))
|
250
|
+
allow(definitions[1]).to(receive(:value).and_return('f'))
|
251
|
+
allow(definitions[1]).to(receive(:sha256).and_return('g'))
|
249
252
|
allow(document).to(receive(:wrong_explicit_checksum?).with(no_args).and_return(false))
|
250
253
|
allow(document).to(receive(:explicit_version?).with(no_args).and_return(false))
|
251
254
|
formatter.export_to("#{aruba.current_directory}/#{target_file}")
|
@@ -6,7 +6,7 @@ require('defmastership')
|
|
6
6
|
RSpec.describe(DefMastership::DefinitionParser) do
|
7
7
|
subject(:parser) { described_class.new(callback_object) }
|
8
8
|
|
9
|
-
let(:callback_object) {
|
9
|
+
let(:callback_object) { double }
|
10
10
|
|
11
11
|
before do
|
12
12
|
allow(callback_object).to(receive(:add_new_definition).with(any_args))
|
@@ -13,7 +13,7 @@ RSpec.describe(DefMastership::Definition) do
|
|
13
13
|
)
|
14
14
|
end
|
15
15
|
|
16
|
-
it { is_expected.not_to(
|
16
|
+
it { is_expected.not_to(be_nil) }
|
17
17
|
it { is_expected.to(have_attributes(type: 'req')) }
|
18
18
|
it { is_expected.to(have_attributes(reference: 'TUTU-001')) }
|
19
19
|
it { is_expected.to(have_attributes(lines: [])) }
|
@@ -7,7 +7,7 @@ RSpec.describe(DefMastership::Document) do
|
|
7
7
|
subject(:document) { described_class.new }
|
8
8
|
|
9
9
|
describe '.new' do
|
10
|
-
it { is_expected.not_to(
|
10
|
+
it { is_expected.not_to(be_nil) }
|
11
11
|
it { is_expected.to(have_attributes(definitions: [])) }
|
12
12
|
it { is_expected.to(have_attributes(eref: {})) }
|
13
13
|
it { is_expected.to(have_attributes(iref: false)) }
|
@@ -323,7 +323,7 @@ RSpec.describe(DefMastership::Document) do
|
|
323
323
|
it { expect(definition).to(have_received(:add_iref).with('toto')) }
|
324
324
|
it { expect(definition).to(have_received(:add_iref).with('tutu')) }
|
325
325
|
it { expect(definition).to(have_received(:add_iref).with('pouet')) }
|
326
|
-
it { expect(document.iref).to(
|
326
|
+
it { expect(document.iref).to(be(true)) }
|
327
327
|
end
|
328
328
|
|
329
329
|
context 'when configure attributes' do
|
@@ -365,7 +365,7 @@ RSpec.describe(DefMastership::Document) do
|
|
365
365
|
|
366
366
|
it do
|
367
367
|
document.parse(input_lines)
|
368
|
-
expect(document.iref).to(
|
368
|
+
expect(document.iref).to(be(false))
|
369
369
|
end
|
370
370
|
end
|
371
371
|
|
@@ -522,8 +522,12 @@ RSpec.describe(DefMastership::Document) do
|
|
522
522
|
end
|
523
523
|
|
524
524
|
describe '#wrong_explicit_checksum?' do
|
525
|
-
let(:
|
526
|
-
|
525
|
+
let(:defs) do
|
526
|
+
[
|
527
|
+
instance_double(DefMastership::Definition, 'definition'),
|
528
|
+
instance_double(DefMastership::Definition, 'definition')
|
529
|
+
]
|
530
|
+
end
|
527
531
|
let(:input_lines) do
|
528
532
|
[
|
529
533
|
'[define, requirement, TOTO-0001]',
|
@@ -535,41 +539,45 @@ RSpec.describe(DefMastership::Document) do
|
|
535
539
|
end
|
536
540
|
|
537
541
|
before do
|
538
|
-
allow(DefMastership::Definition).to(receive(:new).twice.and_return(
|
539
|
-
allow(
|
540
|
-
allow(
|
541
|
-
allow(
|
542
|
-
allow(
|
542
|
+
allow(DefMastership::Definition).to(receive(:new).twice.and_return(defs[0], defs[1]))
|
543
|
+
allow(defs[0]).to(receive(:labels)).and_return([])
|
544
|
+
allow(defs[1]).to(receive(:labels)).and_return([])
|
545
|
+
allow(defs[0]).to(receive(:<<).and_return(defs[0]))
|
546
|
+
allow(defs[1]).to(receive(:<<).and_return(defs[1]))
|
543
547
|
end
|
544
548
|
|
545
549
|
context 'when no wrong explicit checksum' do
|
546
550
|
before do
|
547
|
-
allow(
|
548
|
-
allow(
|
551
|
+
allow(defs[0]).to(receive(:wrong_explicit_checksum)).and_return(nil)
|
552
|
+
allow(defs[1]).to(receive(:wrong_explicit_checksum)).and_return(nil)
|
549
553
|
document.parse(input_lines)
|
550
554
|
document.wrong_explicit_checksum?
|
551
555
|
end
|
552
556
|
|
553
|
-
it { expect(
|
554
|
-
it { expect(
|
555
|
-
it { expect(document.wrong_explicit_checksum?).to(
|
557
|
+
it { expect(defs[0]).to(have_received(:wrong_explicit_checksum)) }
|
558
|
+
it { expect(defs[1]).to(have_received(:wrong_explicit_checksum)) }
|
559
|
+
it { expect(document.wrong_explicit_checksum?).to(be(false)) }
|
556
560
|
end
|
557
561
|
|
558
562
|
context 'when one req has wrong explicit checksum' do
|
559
563
|
before do
|
560
|
-
allow(
|
561
|
-
allow(
|
564
|
+
allow(defs[0]).to(receive(:wrong_explicit_checksum)).and_return(nil)
|
565
|
+
allow(defs[1]).to(receive(:wrong_explicit_checksum)).and_return('toto')
|
562
566
|
document.parse(input_lines)
|
563
567
|
document.wrong_explicit_checksum?
|
564
568
|
end
|
565
569
|
|
566
|
-
it { expect(document.wrong_explicit_checksum?).to(
|
570
|
+
it { expect(document.wrong_explicit_checksum?).to(be(true)) }
|
567
571
|
end
|
568
572
|
end
|
569
573
|
|
570
574
|
describe '#explicit_version?' do
|
571
|
-
let(:
|
572
|
-
|
575
|
+
let(:defs) do
|
576
|
+
[
|
577
|
+
instance_double(DefMastership::Definition, 'definition'),
|
578
|
+
instance_double(DefMastership::Definition, 'definition')
|
579
|
+
]
|
580
|
+
end
|
573
581
|
let(:input_lines) do
|
574
582
|
[
|
575
583
|
'[define, requirement, TOTO-0001]',
|
@@ -581,41 +589,45 @@ RSpec.describe(DefMastership::Document) do
|
|
581
589
|
end
|
582
590
|
|
583
591
|
before do
|
584
|
-
allow(DefMastership::Definition).to(receive(:new).twice.and_return(
|
585
|
-
allow(
|
586
|
-
allow(
|
587
|
-
allow(
|
588
|
-
allow(
|
592
|
+
allow(DefMastership::Definition).to(receive(:new).twice.and_return(defs[0], defs[1]))
|
593
|
+
allow(defs[0]).to(receive(:labels)).and_return([])
|
594
|
+
allow(defs[1]).to(receive(:labels)).and_return([])
|
595
|
+
allow(defs[0]).to(receive(:<<).and_return(defs[0]))
|
596
|
+
allow(defs[1]).to(receive(:<<).and_return(defs[1]))
|
589
597
|
end
|
590
598
|
|
591
599
|
context 'when no explicit version' do
|
592
600
|
before do
|
593
|
-
allow(
|
594
|
-
allow(
|
601
|
+
allow(defs[0]).to(receive(:explicit_version)).and_return(nil)
|
602
|
+
allow(defs[1]).to(receive(:explicit_version)).and_return(nil)
|
595
603
|
document.parse(input_lines)
|
596
604
|
document.explicit_version?
|
597
605
|
end
|
598
606
|
|
599
|
-
it { expect(
|
600
|
-
it { expect(
|
601
|
-
it { expect(document.explicit_version?).to(
|
607
|
+
it { expect(defs[0]).to(have_received(:explicit_version)) }
|
608
|
+
it { expect(defs[1]).to(have_received(:explicit_version)) }
|
609
|
+
it { expect(document.explicit_version?).to(be(false)) }
|
602
610
|
end
|
603
611
|
|
604
612
|
context 'when one req has explicit version' do
|
605
613
|
before do
|
606
|
-
allow(
|
607
|
-
allow(
|
614
|
+
allow(defs[0]).to(receive(:explicit_version)).and_return(nil)
|
615
|
+
allow(defs[1]).to(receive(:explicit_version)).and_return('toto')
|
608
616
|
document.parse(input_lines)
|
609
617
|
document.explicit_version?
|
610
618
|
end
|
611
619
|
|
612
|
-
it { expect(document.explicit_version?).to(
|
620
|
+
it { expect(document.explicit_version?).to(be(true)) }
|
613
621
|
end
|
614
622
|
end
|
615
623
|
|
616
624
|
describe '#ref_to_def?' do
|
617
|
-
let(:
|
618
|
-
|
625
|
+
let(:defs) do
|
626
|
+
[
|
627
|
+
instance_double(DefMastership::Definition, 'definition'),
|
628
|
+
instance_double(DefMastership::Definition, 'definition')
|
629
|
+
]
|
630
|
+
end
|
619
631
|
let(:input_lines) do
|
620
632
|
[
|
621
633
|
'[define, requirement, TOTO-0001]',
|
@@ -627,17 +639,17 @@ RSpec.describe(DefMastership::Document) do
|
|
627
639
|
end
|
628
640
|
|
629
641
|
before do
|
630
|
-
allow(DefMastership::Definition).to(receive(:new).twice.and_return(
|
631
|
-
allow(
|
632
|
-
allow(
|
633
|
-
allow(
|
634
|
-
allow(
|
635
|
-
allow(
|
636
|
-
allow(
|
642
|
+
allow(DefMastership::Definition).to(receive(:new).twice.and_return(defs[0], defs[1]))
|
643
|
+
allow(defs[0]).to(receive(:labels)).and_return([])
|
644
|
+
allow(defs[1]).to(receive(:labels)).and_return([])
|
645
|
+
allow(defs[0]).to(receive(:<<).and_return(defs[0]))
|
646
|
+
allow(defs[1]).to(receive(:<<).and_return(defs[1]))
|
647
|
+
allow(defs[0]).to(receive(:reference).and_return('TOTO-0001'))
|
648
|
+
allow(defs[1]).to(receive(:reference).and_return('TOTO-0002'))
|
637
649
|
document.parse(input_lines)
|
638
650
|
end
|
639
651
|
|
640
|
-
it { expect(document.ref_to_def('TOTO-0001')).to(eq(
|
641
|
-
it { expect(document.ref_to_def('TOTO-0002')).to(eq(
|
652
|
+
it { expect(document.ref_to_def('TOTO-0001')).to(eq(defs[0])) }
|
653
|
+
it { expect(document.ref_to_def('TOTO-0002')).to(eq(defs[1])) }
|
642
654
|
end
|
643
655
|
end
|
@@ -9,29 +9,29 @@ RSpec.describe(DefMastership::ParsingState) do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
describe '.new' do
|
12
|
-
it { is_expected.not_to(
|
12
|
+
it { is_expected.not_to(be_nil) }
|
13
13
|
end
|
14
14
|
|
15
15
|
describe '#enabled_with?' do
|
16
16
|
context 'when single line commment' do
|
17
|
-
it { expect(parsing_state.enabled?("//whatever\n")).to(
|
17
|
+
it { expect(parsing_state.enabled?("//whatever\n")).to(be(false)) }
|
18
18
|
end
|
19
19
|
|
20
20
|
context 'when starting' do
|
21
|
-
it { expect(parsing_state.enabled?("whatever\n")).to(
|
22
|
-
it { expect(parsing_state.enabled?("----\n")).to(
|
23
|
-
it { expect(parsing_state.enabled?("....\n")).to(
|
24
|
-
it { expect(parsing_state.enabled?("////\n")).to(
|
25
|
-
it { expect(parsing_state.enabled?('....')).to(
|
21
|
+
it { expect(parsing_state.enabled?("whatever\n")).to(be(true)) }
|
22
|
+
it { expect(parsing_state.enabled?("----\n")).to(be(false)) }
|
23
|
+
it { expect(parsing_state.enabled?("....\n")).to(be(false)) }
|
24
|
+
it { expect(parsing_state.enabled?("////\n")).to(be(false)) }
|
25
|
+
it { expect(parsing_state.enabled?('....')).to(be(false)) }
|
26
26
|
end
|
27
27
|
|
28
28
|
context 'when disabled' do
|
29
29
|
before { parsing_state.enabled?("----\n") }
|
30
30
|
|
31
|
-
it { expect(parsing_state.enabled?("whatever\n")).to(
|
32
|
-
it { expect(parsing_state.enabled?("----\n")).to(
|
33
|
-
it { expect(parsing_state.enabled?("....\n")).to(
|
34
|
-
it { expect(parsing_state.enabled?("////\n")).to(
|
31
|
+
it { expect(parsing_state.enabled?("whatever\n")).to(be(false)) }
|
32
|
+
it { expect(parsing_state.enabled?("----\n")).to(be(true)) }
|
33
|
+
it { expect(parsing_state.enabled?("....\n")).to(be(false)) }
|
34
|
+
it { expect(parsing_state.enabled?("////\n")).to(be(false)) }
|
35
35
|
end
|
36
36
|
|
37
37
|
context 'with intricated disables starting with "...."' do
|
@@ -39,8 +39,8 @@ RSpec.describe(DefMastership::ParsingState) do
|
|
39
39
|
["....\n", "----\n", "whatever\n"].each { |line| parsing_state.enabled?(line) }
|
40
40
|
end
|
41
41
|
|
42
|
-
it { expect(parsing_state.enabled?("----\n")).to(
|
43
|
-
it { expect(parsing_state.enabled?("....\n")).to(
|
42
|
+
it { expect(parsing_state.enabled?("----\n")).to(be(false)) }
|
43
|
+
it { expect(parsing_state.enabled?("....\n")).to(be(true)) }
|
44
44
|
end
|
45
45
|
|
46
46
|
context 'with intricated disables starting with "----"' do
|
@@ -48,7 +48,7 @@ RSpec.describe(DefMastership::ParsingState) do
|
|
48
48
|
["....\n", "----\n", "whatever\n"].each { |line| parsing_state.enabled?(line) }
|
49
49
|
end
|
50
50
|
|
51
|
-
it { expect(parsing_state.enabled?("....\n")).to(
|
51
|
+
it { expect(parsing_state.enabled?("....\n")).to(be(true)) }
|
52
52
|
end
|
53
53
|
|
54
54
|
context 'with intricated disables starting with "////"' do
|
@@ -56,7 +56,7 @@ RSpec.describe(DefMastership::ParsingState) do
|
|
56
56
|
["////\n", "----\n", "whatever\n"].each { |line| parsing_state.enabled?(line) }
|
57
57
|
end
|
58
58
|
|
59
|
-
it { expect(parsing_state.enabled?("////\n")).to(
|
59
|
+
it { expect(parsing_state.enabled?("////\n")).to(be(true)) }
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
@@ -7,11 +7,15 @@ RSpec.describe(DefMastership::RenameIncludedFilesLineModifier) do
|
|
7
7
|
subject(:includeschanger) { described_class.new }
|
8
8
|
|
9
9
|
describe '.new' do
|
10
|
-
it { is_expected.not_to(
|
10
|
+
it { is_expected.not_to(be_nil) }
|
11
11
|
it { is_expected.to(have_attributes(from_regexp: '')) }
|
12
12
|
it { is_expected.to(have_attributes(to_template: '')) }
|
13
13
|
it { is_expected.to(have_attributes(changes: [])) }
|
14
|
-
|
14
|
+
|
15
|
+
it do
|
16
|
+
expect { includeschanger.user_defined_attribute }
|
17
|
+
.to(raise_error(NoMethodError))
|
18
|
+
end
|
15
19
|
end
|
16
20
|
|
17
21
|
describe '.from_config' do
|
@@ -22,7 +26,7 @@ RSpec.describe(DefMastership::RenameIncludedFilesLineModifier) do
|
|
22
26
|
)
|
23
27
|
end
|
24
28
|
|
25
|
-
it { is_expected.not_to(
|
29
|
+
it { is_expected.not_to(be_nil) }
|
26
30
|
it { is_expected.to(have_attributes(from_regexp: 'Whatever.+')) }
|
27
31
|
it { is_expected.to(have_attributes(to_template: 'Whatever')) }
|
28
32
|
end
|
@@ -18,7 +18,7 @@ RSpec.describe(DefMastership::RenameIncludedFilesModifier) do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
describe '.new' do
|
21
|
-
it { is_expected.not_to(
|
21
|
+
it { is_expected.not_to(be_nil) }
|
22
22
|
it { is_expected.to(have_attributes(config: 'fake config')) }
|
23
23
|
it { is_expected.to(have_attributes(changes: [])) }
|
24
24
|
end
|
@@ -7,10 +7,14 @@ RSpec.describe(DefMastership::UpdateDefChecksumLineModifier) do
|
|
7
7
|
subject(:linemodifier) { described_class.new }
|
8
8
|
|
9
9
|
describe '.new' do
|
10
|
-
it { is_expected.not_to(
|
10
|
+
it { is_expected.not_to(be_nil) }
|
11
11
|
it { is_expected.to(have_attributes(def_type: '')) }
|
12
12
|
it { is_expected.to(have_attributes(changes: [])) }
|
13
|
-
|
13
|
+
|
14
|
+
it do
|
15
|
+
expect { linemodifier.user_defined_attribute }
|
16
|
+
.to(raise_error(NoMethodError))
|
17
|
+
end
|
14
18
|
end
|
15
19
|
|
16
20
|
describe '.from_config' do
|
@@ -20,7 +24,7 @@ RSpec.describe(DefMastership::UpdateDefChecksumLineModifier) do
|
|
20
24
|
)
|
21
25
|
end
|
22
26
|
|
23
|
-
it { is_expected.not_to(
|
27
|
+
it { is_expected.not_to(be_nil) }
|
24
28
|
it { is_expected.to(have_attributes(def_type: 'requirement')) }
|
25
29
|
it { is_expected.to(have_attributes(document: nil)) }
|
26
30
|
end
|
@@ -18,7 +18,7 @@ RSpec.describe(DefMastership::UpdateDefChecksumModifier) do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
describe '.new' do
|
21
|
-
it { is_expected.not_to(
|
21
|
+
it { is_expected.not_to(be_nil) }
|
22
22
|
it { is_expected.to(have_attributes(config: 'fake config')) }
|
23
23
|
it { is_expected.to(have_attributes(changes: [])) }
|
24
24
|
end
|
@@ -7,10 +7,14 @@ RSpec.describe(DefMastership::UpdateDefVersionLineModifier) do
|
|
7
7
|
subject(:linemodifier) { described_class.new }
|
8
8
|
|
9
9
|
describe '.new' do
|
10
|
-
it { is_expected.not_to(
|
10
|
+
it { is_expected.not_to(be_nil) }
|
11
11
|
it { is_expected.to(have_attributes(def_type: '')) }
|
12
12
|
it { is_expected.to(have_attributes(changes: [])) }
|
13
|
-
|
13
|
+
|
14
|
+
it do
|
15
|
+
expect { linemodifier.user_defined_attribute }
|
16
|
+
.to(raise_error(NoMethodError))
|
17
|
+
end
|
14
18
|
end
|
15
19
|
|
16
20
|
describe '.from_config' do
|
@@ -21,7 +25,7 @@ RSpec.describe(DefMastership::UpdateDefVersionLineModifier) do
|
|
21
25
|
)
|
22
26
|
end
|
23
27
|
|
24
|
-
it { is_expected.not_to(
|
28
|
+
it { is_expected.not_to(be_nil) }
|
25
29
|
it { is_expected.to(have_attributes(def_type: 'requirement')) }
|
26
30
|
it { is_expected.to(have_attributes(first_version: 'a')) }
|
27
31
|
it { is_expected.to(have_attributes(document: nil)) }
|
@@ -18,7 +18,7 @@ RSpec.describe(DefMastership::UpdateDefVersionModifier) do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
describe '.new' do
|
21
|
-
it { is_expected.not_to(
|
21
|
+
it { is_expected.not_to(be_nil) }
|
22
22
|
it { is_expected.to(have_attributes(config: { ref_document: 'ref.adoc' })) }
|
23
23
|
it { is_expected.to(have_attributes(changes: [])) }
|
24
24
|
end
|
@@ -30,7 +30,7 @@ RSpec.describe(DefMastership::UpdateDefVersionModifier) do
|
|
30
30
|
|
31
31
|
before do
|
32
32
|
allow(DefMastership::UpdateDefVersionLineModifier).to(
|
33
|
-
receive(:from_config).with(ref_document: 'ref.adoc').and_return(line_modifier)
|
33
|
+
receive(:from_config).with({ ref_document: 'ref.adoc' }).and_return(line_modifier)
|
34
34
|
)
|
35
35
|
allow(DefMastership::Document).to(receive(:new).and_return(document, ref_document))
|
36
36
|
allow(document).to(receive(:parse_file_with_preprocessor))
|
@@ -50,7 +50,7 @@ RSpec.describe(DefMastership::UpdateDefVersionModifier) do
|
|
50
50
|
|
51
51
|
it do
|
52
52
|
expect(DefMastership::UpdateDefVersionLineModifier).to(
|
53
|
-
have_received(:from_config).with(ref_document: 'ref.adoc')
|
53
|
+
have_received(:from_config).with({ ref_document: 'ref.adoc' })
|
54
54
|
)
|
55
55
|
end
|
56
56
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jérôme Arbez-Gindre
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aruba
|
@@ -16,14 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
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'
|
20
34
|
type: :development
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
38
|
- - "~>"
|
25
39
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
40
|
+
version: '8'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rake
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,42 +86,56 @@ dependencies:
|
|
72
86
|
requirements:
|
73
87
|
- - '='
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version: '1.
|
89
|
+
version: '1.50'
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - '='
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: '1.
|
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'
|
83
111
|
- !ruby/object:Gem::Dependency
|
84
112
|
name: rubocop-rake
|
85
113
|
requirement: !ruby/object:Gem::Requirement
|
86
114
|
requirements:
|
87
115
|
- - "~>"
|
88
116
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0.
|
117
|
+
version: '0.6'
|
90
118
|
type: :development
|
91
119
|
prerelease: false
|
92
120
|
version_requirements: !ruby/object:Gem::Requirement
|
93
121
|
requirements:
|
94
122
|
- - "~>"
|
95
123
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0.
|
124
|
+
version: '0.6'
|
97
125
|
- !ruby/object:Gem::Dependency
|
98
126
|
name: rubocop-rspec
|
99
127
|
requirement: !ruby/object:Gem::Requirement
|
100
128
|
requirements:
|
101
129
|
- - "~>"
|
102
130
|
- !ruby/object:Gem::Version
|
103
|
-
version: '2.
|
131
|
+
version: '2.22'
|
104
132
|
type: :development
|
105
133
|
prerelease: false
|
106
134
|
version_requirements: !ruby/object:Gem::Requirement
|
107
135
|
requirements:
|
108
136
|
- - "~>"
|
109
137
|
- !ruby/object:Gem::Version
|
110
|
-
version: '2.
|
138
|
+
version: '2.22'
|
111
139
|
- !ruby/object:Gem::Dependency
|
112
140
|
name: simplecov
|
113
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -164,7 +192,7 @@ dependencies:
|
|
164
192
|
- - "~>"
|
165
193
|
- !ruby/object:Gem::Version
|
166
194
|
version: '2'
|
167
|
-
description:
|
195
|
+
description:
|
168
196
|
email: jeromearbezgindre@gmail.com
|
169
197
|
executables:
|
170
198
|
- defmastership
|
@@ -225,29 +253,30 @@ files:
|
|
225
253
|
- lib/defmastership/update_def_version_modifier.rb
|
226
254
|
- lib/defmastership/version.rb
|
227
255
|
- spec/spec_helper.rb
|
228
|
-
- spec/unit/
|
229
|
-
- spec/unit/
|
230
|
-
- spec/unit/
|
231
|
-
- spec/unit/
|
232
|
-
- spec/unit/
|
233
|
-
- spec/unit/
|
234
|
-
- spec/unit/
|
235
|
-
- spec/unit/
|
236
|
-
- spec/unit/
|
237
|
-
- spec/unit/
|
238
|
-
- spec/unit/
|
239
|
-
- spec/unit/
|
240
|
-
- spec/unit/
|
241
|
-
- spec/unit/
|
242
|
-
- spec/unit/
|
243
|
-
- spec/unit/
|
244
|
-
- spec/unit/
|
245
|
-
- spec/unit/
|
256
|
+
- spec/unit/def_mastership/batch_modifier_spec.rb
|
257
|
+
- spec/unit/def_mastership/change_ref_line_modifier_spec.rb
|
258
|
+
- spec/unit/def_mastership/change_ref_modifier_spec.rb
|
259
|
+
- spec/unit/def_mastership/csv_formatter_body_spec.rb
|
260
|
+
- spec/unit/def_mastership/csv_formatter_header_spec.rb
|
261
|
+
- spec/unit/def_mastership/csv_formatter_spec.rb
|
262
|
+
- spec/unit/def_mastership/definition_parser_spec.rb
|
263
|
+
- spec/unit/def_mastership/definition_spec.rb
|
264
|
+
- spec/unit/def_mastership/document_spec.rb
|
265
|
+
- spec/unit/def_mastership/parsing_state_spec.rb
|
266
|
+
- spec/unit/def_mastership/rename_included_files_line_modifier_spec.rb
|
267
|
+
- spec/unit/def_mastership/rename_included_files_modifier_spec.rb
|
268
|
+
- spec/unit/def_mastership/string_spec.rb
|
269
|
+
- spec/unit/def_mastership/update_def_checksum_line_modifier_spec.rb
|
270
|
+
- spec/unit/def_mastership/update_def_checksum_modifier_spec.rb
|
271
|
+
- spec/unit/def_mastership/update_def_version_line_modifier_spec.rb
|
272
|
+
- spec/unit/def_mastership/update_def_version_modifier_spec.rb
|
273
|
+
- spec/unit/def_mastership_spec.rb
|
246
274
|
homepage: https://gitlab.com/jjag/defmastership/
|
247
275
|
licenses:
|
248
276
|
- MIT
|
249
|
-
metadata:
|
250
|
-
|
277
|
+
metadata:
|
278
|
+
rubygems_mfa_required: 'true'
|
279
|
+
post_install_message:
|
251
280
|
rdoc_options:
|
252
281
|
- "--title defmastership"
|
253
282
|
- "--main README.rdoc"
|
@@ -259,15 +288,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
259
288
|
requirements:
|
260
289
|
- - ">="
|
261
290
|
- !ruby/object:Gem::Version
|
262
|
-
version: '2.
|
291
|
+
version: '2.7'
|
263
292
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
264
293
|
requirements:
|
265
294
|
- - ">="
|
266
295
|
- !ruby/object:Gem::Version
|
267
296
|
version: '0'
|
268
297
|
requirements: []
|
269
|
-
rubygems_version: 3.
|
270
|
-
signing_key:
|
298
|
+
rubygems_version: 3.4.5
|
299
|
+
signing_key:
|
271
300
|
specification_version: 4
|
272
301
|
summary: Handling of references and definitions with asciidoctor
|
273
302
|
test_files: []
|
File without changes
|