simplecov-compare 0.2.1 → 0.2.2
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/lib/simplecov/compare/formatter/markdown_formatter.rb +1 -1
- data/lib/simplecov/compare/result_set_comparison.rb +4 -0
- data/lib/simplecov/compare/version.rb +1 -1
- data/test/simplecov/compare/formatter/markdown_formatter_test.rb +2 -1
- data/test/simplecov/compare/result_set_comparison_test.rb +18 -0
- data/test/simplecov/compare_test.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 59d0f8ddaf12be41483ee9b154afc0dd1e1f7b9c2a34cbc6667c69b294c94861
|
|
4
|
+
data.tar.gz: f8f457fdc5a5925ab23dde8ade1cf8b5e01fefc91e84d43d390afc740d48649d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e06038b32b2c2d24656c6365332d04db7550b9086e402cf735d3de44684a96bd22fc72186cc7f539d6f9379fe12a7666df5e9fd6ab457092bace63377609c9cd
|
|
7
|
+
data.tar.gz: ce90c7ad9fa0232333b8595b8d4d15e1230c5c0119a0332383d37aeb98277a1f57407ba4c2eb8e07c85ef0b8da8fd95011fc92f093b6af5476eb4fe71722cc2f
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -58,4 +58,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
|
58
58
|
|
|
59
59
|
## Code of Conduct
|
|
60
60
|
|
|
61
|
-
Everyone interacting in the Simplecov::Compare project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/kevin-j-m
|
|
61
|
+
Everyone interacting in the Simplecov::Compare project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/kevin-j-m/simplecov-compare/blob/main/CODE_OF_CONDUCT.md).
|
|
@@ -56,7 +56,7 @@ module Simplecov
|
|
|
56
56
|
def file_differences(result_set_comparison)
|
|
57
57
|
if result_set_comparison.file_differences?
|
|
58
58
|
<<~FILE_DIFF
|
|
59
|
-
## File Differences
|
|
59
|
+
## File Differences (#{result_set_comparison.num_file_differences})
|
|
60
60
|
|
|
61
61
|
| File Name | Delta | From | To |
|
|
62
62
|
| --------- | ----- | ---- | -- |
|
|
@@ -56,6 +56,7 @@ module Simplecov
|
|
|
56
56
|
stubs { big_increase.new_num_relevant_lines }.with { 4 }
|
|
57
57
|
|
|
58
58
|
stubs { comparison.file_differences }.with { [big_increase, small_decrease, big_decrease, small_increase] }
|
|
59
|
+
stubs { comparison.num_file_differences }.with { 4 }
|
|
59
60
|
|
|
60
61
|
markdown_result = <<~MARKDOWN
|
|
61
62
|
# Coverage Comparison
|
|
@@ -64,7 +65,7 @@ module Simplecov
|
|
|
64
65
|
|
|
65
66
|
Coverage increased 9 points from 33% to 42%.
|
|
66
67
|
|
|
67
|
-
## File Differences
|
|
68
|
+
## File Differences (4)
|
|
68
69
|
|
|
69
70
|
| File Name | Delta | From | To |
|
|
70
71
|
| --------- | ----- | ---- | -- |
|
|
@@ -244,6 +244,24 @@ module Simplecov
|
|
|
244
244
|
assert_equal false, comparison.file_differences?
|
|
245
245
|
end
|
|
246
246
|
end
|
|
247
|
+
|
|
248
|
+
describe "#num_file_differences" do
|
|
249
|
+
it "counts the number of differences found" do
|
|
250
|
+
base_file = Mocktail.of(FileResult)
|
|
251
|
+
stubs { base_file.lines_covered_percent }.with { 5 }
|
|
252
|
+
stubs { base_file.filename }.with { "base.rb" }
|
|
253
|
+
|
|
254
|
+
base = Mocktail.of(ResultSet)
|
|
255
|
+
stubs { base.files }.with { [base_file] }
|
|
256
|
+
|
|
257
|
+
other = Mocktail.of(ResultSet)
|
|
258
|
+
stubs { other.files }.with { [] }
|
|
259
|
+
|
|
260
|
+
comparison = ResultSetComparison.new(base, to: other)
|
|
261
|
+
|
|
262
|
+
assert_equal 1, comparison.num_file_differences
|
|
263
|
+
end
|
|
264
|
+
end
|
|
247
265
|
end
|
|
248
266
|
end
|
|
249
267
|
end
|