Skip to content

Commit

Permalink
Fix rspec metadata parsing on empty full description
Browse files Browse the repository at this point in the history
[Fix #1237]
  • Loading branch information
mbj committed Jun 30, 2024
1 parent ee3d5c2 commit 47f6bad
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 26 deletions.
7 changes: 6 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# v0.12.4 2024-06-30

* [#1455](https://github.com/mbj/mutant/pull/1454)

Fix parsing of empty rspec descriptions

# v0.12.3 2024-06-10

* [#1452](https://github.com/mbj/mutant/pull/1451)

Remove support for EOL Ruby-3.0.
Remove another invalid mutation to super().


# v0.12.2 2024-06-09

* [#1450](https://github.com/mbj/mutant/pull/1450)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
mutant (0.12.3)
mutant (0.12.4)
diff-lcs (~> 1.3)
parser (~> 3.3.0)
regexp_parser (~> 2.9.0)
Expand Down
2 changes: 1 addition & 1 deletion lib/mutant/integration/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def parse_metadata(metadata)

expressions.map(&method(:parse_expression))
else
match = EXPRESSION_CANDIDATE.match(metadata.fetch(:full_description))
match = EXPRESSION_CANDIDATE.match(metadata.fetch(:full_description)) or return [ALL_EXPRESSION]
[parse_expression(Util.one(match.captures)) { ALL_EXPRESSION }]
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/mutant/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

module Mutant
# Current mutant version
VERSION = '0.12.3'
VERSION = '0.12.4'
end # Mutant
16 changes: 15 additions & 1 deletion spec/unit/mutant/integration/rspec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,21 @@
)
end

let(:example_g) do
double(
'Example G',
metadata: {
location: 'example-g-location',
full_description: ''
}
)
end

let(:leaf_example_group) do
class_double(
RSpec::Core::ExampleGroup,
'leaf example group',
examples: [example_a, example_b, example_c, example_d, example_e, example_f]
examples: [example_a, example_b, example_c, example_d, example_e, example_f, example_g]
)
end

Expand Down Expand Up @@ -147,6 +157,10 @@
Mutant::Test.new(
id: 'rspec:5:example-f-location/Example::F',
expressions: [parse_expression('Foo'), parse_expression('Bar')]
),
Mutant::Test.new(
id: 'rspec:6:example-g-location/',
expressions: [parse_expression('*')]
)
]
end
Expand Down
6 changes: 3 additions & 3 deletions test_app/Gemfile.minitest.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
PATH
remote: ..
specs:
mutant (0.12.3)
mutant (0.12.4)
diff-lcs (~> 1.3)
parser (~> 3.3.0)
regexp_parser (~> 2.9.0)
sorbet-runtime (~> 0.5.0)
unparser (~> 0.6.14)
mutant-minitest (0.12.3)
mutant-minitest (0.12.4)
minitest (~> 5.11)
mutant (= 0.12.3)
mutant (= 0.12.4)

GEM
remote: https://rubygems.org/
Expand Down
6 changes: 3 additions & 3 deletions test_app/Gemfile.rspec3.10.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
PATH
remote: ..
specs:
mutant (0.12.3)
mutant (0.12.4)
diff-lcs (~> 1.3)
parser (~> 3.3.0)
regexp_parser (~> 2.9.0)
sorbet-runtime (~> 0.5.0)
unparser (~> 0.6.14)
mutant-rspec (0.12.3)
mutant (= 0.12.3)
mutant-rspec (0.12.4)
mutant (= 0.12.4)
rspec-core (>= 3.8.0, < 4.0.0)

GEM
Expand Down
6 changes: 3 additions & 3 deletions test_app/Gemfile.rspec3.11.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
PATH
remote: ..
specs:
mutant (0.12.3)
mutant (0.12.4)
diff-lcs (~> 1.3)
parser (~> 3.3.0)
regexp_parser (~> 2.9.0)
sorbet-runtime (~> 0.5.0)
unparser (~> 0.6.14)
mutant-rspec (0.12.3)
mutant (= 0.12.3)
mutant-rspec (0.12.4)
mutant (= 0.12.4)
rspec-core (>= 3.8.0, < 4.0.0)

GEM
Expand Down
6 changes: 3 additions & 3 deletions test_app/Gemfile.rspec3.12.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
PATH
remote: ..
specs:
mutant (0.12.3)
mutant (0.12.4)
diff-lcs (~> 1.3)
parser (~> 3.3.0)
regexp_parser (~> 2.9.0)
sorbet-runtime (~> 0.5.0)
unparser (~> 0.6.14)
mutant-rspec (0.12.3)
mutant (= 0.12.3)
mutant-rspec (0.12.4)
mutant (= 0.12.4)
rspec-core (>= 3.8.0, < 4.0.0)

GEM
Expand Down
6 changes: 3 additions & 3 deletions test_app/Gemfile.rspec3.13.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
PATH
remote: ..
specs:
mutant (0.12.3)
mutant (0.12.4)
diff-lcs (~> 1.3)
parser (~> 3.3.0)
regexp_parser (~> 2.9.0)
sorbet-runtime (~> 0.5.0)
unparser (~> 0.6.14)
mutant-rspec (0.12.3)
mutant (= 0.12.3)
mutant-rspec (0.12.4)
mutant (= 0.12.4)
rspec-core (>= 3.8.0, < 4.0.0)

GEM
Expand Down
6 changes: 3 additions & 3 deletions test_app/Gemfile.rspec3.8.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
PATH
remote: ..
specs:
mutant (0.12.3)
mutant (0.12.4)
diff-lcs (~> 1.3)
parser (~> 3.3.0)
regexp_parser (~> 2.9.0)
sorbet-runtime (~> 0.5.0)
unparser (~> 0.6.14)
mutant-rspec (0.12.3)
mutant (= 0.12.3)
mutant-rspec (0.12.4)
mutant (= 0.12.4)
rspec-core (>= 3.8.0, < 4.0.0)

GEM
Expand Down
6 changes: 3 additions & 3 deletions test_app/Gemfile.rspec3.9.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
PATH
remote: ..
specs:
mutant (0.12.3)
mutant (0.12.4)
diff-lcs (~> 1.3)
parser (~> 3.3.0)
regexp_parser (~> 2.9.0)
sorbet-runtime (~> 0.5.0)
unparser (~> 0.6.14)
mutant-rspec (0.12.3)
mutant (= 0.12.3)
mutant-rspec (0.12.4)
mutant (= 0.12.4)
rspec-core (>= 3.8.0, < 4.0.0)

GEM
Expand Down

0 comments on commit 47f6bad

Please sign in to comment.