defmastership-core 1.5.2 → 1.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b95f1ad54d625a1441f1ca0220e944559232bf9f477b56e9a14c32469622928
4
- data.tar.gz: 060d870d464c07cc9ae12702136d66292e39006af3c617c7bb8f42b4c7e1dc5c
3
+ metadata.gz: 569e097ffe8f9725fd5f5af26b7adb6a1a36cce58a20ed7dbbb43fb3d5043a24
4
+ data.tar.gz: 826d17760e813f5bf07fb95ec9a1b392e4af67daf36a803cd638daf33179e230
5
5
  SHA512:
6
- metadata.gz: 84bfd7c8d7b5ce2e15640fd450e0b8375d73608fc8b09e0b0e7cd989d1f4f10eb4d2d20cdefe9d93b1822cd3b71fc1fe63f123e489d65e3d4e281a1dc2bfeecf
7
- data.tar.gz: 3fadd0ba25f82931f55198c2c0d9c1821e156352e0597ce3e3ca19857bc1ca61bbca7e119f95ea4b95574a485b7b1b455c8f7227731aada5816e068f8152423b
6
+ metadata.gz: b666d773c4507263eea5aeb66a667f855ba40e2c4e83789da152b1108be3048763386711de26c51d5323f735e35bb7727e77d9cf7441b2e8f25cf38eff807e29
7
+ data.tar.gz: 933485a71bc31df74eb8d3648fd21b172de1da4c0f3269d38f99343413001768aa2b876198231b22577b8fb5b9b396a3f6b60f5920c5d49b45c768af506d5489
data/config/mutant.yml CHANGED
@@ -7,10 +7,11 @@ integration:
7
7
  arguments:
8
8
  - --options=config/rspec
9
9
  - spec
10
+ environment_variables:
11
+ CODE_COVERAGE_IN_RSPEC: disabled
10
12
  requires:
11
13
  - defmastership/core/constants
12
14
  - defmastership/core/parsing_state
13
15
  matcher:
14
16
  subjects:
15
17
  - 'Defmastership::Core*'
16
- # fail_fast: true
data/config/rubocop.yml CHANGED
@@ -9,7 +9,7 @@
9
9
  #
10
10
  # See https://github.com/rubocop-hq/rubocop/blob/master/manual/configuration.md
11
11
 
12
- require:
12
+ plugins:
13
13
  - rubocop-performance
14
14
  - rubocop-rspec
15
15
  - rubocop-rake
@@ -40,7 +40,7 @@ module Defmastership
40
40
 
41
41
  # [Regexp] match optional explicit version and explicit checksum
42
42
  DEF_VERSION_AND_CHECKSUM = '(?<version_and_checksum>' \
43
- '\((?<explicit_version>[^~]+)?(?<explicit_checksum>~\h+)?\)' \
43
+ '\((?<explicit_version>[^~]+?)?(?<explicit_checksum>~\h+?)?\)' \
44
44
  ')?'
45
45
  public_constant :DEF_VERSION_AND_CHECKSUM
46
46
 
@@ -49,7 +49,7 @@ module Defmastership
49
49
  public_constant :REFERENCE
50
50
 
51
51
  # [Regexp] match reference with optional version and checksum
52
- REF_WITH_OPT_VER_CHK = "\\s*#{REFERENCE}#{DEF_VERSION_AND_CHECKSUM}\\s*".freeze
52
+ REF_WITH_OPT_VER_CHK = "#{REFERENCE}#{DEF_VERSION_AND_CHECKSUM}".freeze
53
53
  public_constant :REF_WITH_OPT_VER_CHK
54
54
 
55
55
  # [Regexp] match defintion summary
@@ -77,17 +77,14 @@ module Defmastership
77
77
 
78
78
  # [Regexp] match a definition line
79
79
  definition_re_string = <<~"DEF"
80
- ^
81
- \\s*
82
- \\[
80
+ ^\\s*\\[
83
81
  #{DEF_KEYWORD}
84
82
  #{DEF_TYPE}
85
83
  ,
86
- #{REF_WITH_OPT_VER_CHK}
84
+ \\s*#{REF_WITH_OPT_VER_CHK}
87
85
  #{DEF_SUMMARY}
88
86
  #{DEF_LABELS}
89
- \\s*
90
- \\]
87
+ \\s*\\]
91
88
  DEF
92
89
  # [Regexp] match a definition line
93
90
  DEFINITION = Regexp.new(definition_re_string, Regexp::EXTENDED)
@@ -5,7 +5,7 @@ module Defmastership
5
5
  # Common to defmastership and asciidoctor-defmastership
6
6
  module Core
7
7
  # [String] Gem version
8
- VERSION = '1.5.2'
8
+ VERSION = '1.5.4'
9
9
  public_constant :VERSION
10
10
  end
11
11
  end
data/spec/spec_helper.rb CHANGED
@@ -1,20 +1,22 @@
1
1
  # Copyright (c) 2020 Jerome Arbez-Gindre
2
2
  # frozen_string_literal: true
3
3
 
4
- require('simplecov')
4
+ unless ENV['CODE_COVERAGE_IN_RSPEC'] && ENV['DISABLE_CODE_COVERAGE_IN_RSPEC'] != 'disabled'
5
+ require('simplecov')
5
6
 
6
- SimpleCov.start do
7
- command_name 'spec:unit'
7
+ SimpleCov.start do
8
+ command_name 'spec:unit'
8
9
 
9
- add_group 'Libraries', 'lib'
10
- add_group 'Unit test', 'spec/unit'
10
+ add_group 'Libraries', 'lib'
11
+ add_group 'Unit test', 'spec/unit'
11
12
 
12
- add_filter 'config'
13
- add_filter 'vendor'
14
- add_filter 'set_join_hack'
13
+ add_filter 'config'
14
+ add_filter 'vendor'
15
+ add_filter 'set_join_hack'
15
16
 
16
- enable_coverage :branch
17
- minimum_coverage line: 100, branch: 100
17
+ enable_coverage :branch
18
+ minimum_coverage line: 100, branch: 100
19
+ end
18
20
  end
19
21
 
20
22
  RSpec::Matchers.define(:matchdata_including) do |h|
@@ -551,6 +551,8 @@ RSpec.describe(Defmastership::Core::DMRegexp) do
551
551
  it { expect(regexp.match('defs:iref[bla(c~abcd1234)]')[:version_and_checksum]).to(eq('(c~abcd1234)')) }
552
552
  it { expect(regexp.match('defs:iref[bla(c~abcd1234)]')[:explicit_version]).to(eq('c')) }
553
553
  it { expect(regexp.match('defs:iref[bla(c~abcd1234)]')[:explicit_checksum]).to(eq('~abcd1234')) }
554
+ it { expect(regexp.match('defs:iref[bla(c)] defs:iref[bla(c~abcd1234)]')[:explicit_version]).to(eq('c')) }
555
+ it { expect(regexp.match('defs:iref[bla(~abcd1234)] defs:iref[bla(c)')[:explicit_checksum]).to(eq('~abcd1234')) }
554
556
  end
555
557
 
556
558
  context 'with invalid IREF_DEF' do
data/tasks/test.rake CHANGED
@@ -8,6 +8,18 @@ namespace 'test' do
8
8
  t.rspec_opts = ['--options config/rspec']
9
9
  end
10
10
 
11
+ desc 'mutation testing'
12
+ task :mutation do
13
+ sh 'mutant run'
14
+ end
15
+
16
+ namespace 'mutation' do
17
+ desc 'mutation testing (fail fast)'
18
+ task :ff do
19
+ sh 'mutant run --fail-fast'
20
+ end
21
+ end
22
+
11
23
  desc 'Runs all unit tests'
12
24
  task(all: ['test:spec'])
13
25
  end
@@ -17,3 +29,6 @@ task(spec: 'test:spec')
17
29
 
18
30
  desc 'Synonym for test:all'
19
31
  task(test: 'test:all')
32
+
33
+ desc 'Synonym for test:mutation'
34
+ task(mutation: 'test:mutation')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: defmastership-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jérôme Arbez-Gindre
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0'
60
60
  requirements: []
61
- rubygems_version: 3.7.1
61
+ rubygems_version: 3.6.9
62
62
  specification_version: 4
63
63
  summary: Handling of references and definitions with asciidoctor - common code
64
64
  test_files: []