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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb79a5feaecb5a4c62831915911854abfffc988d41bd52490bb0962d0b407409
4
- data.tar.gz: 7d213a106d6db184523a55eca5d28fa64ae1904477449fc43623547d0fc96137
3
+ metadata.gz: 59d0f8ddaf12be41483ee9b154afc0dd1e1f7b9c2a34cbc6667c69b294c94861
4
+ data.tar.gz: f8f457fdc5a5925ab23dde8ade1cf8b5e01fefc91e84d43d390afc740d48649d
5
5
  SHA512:
6
- metadata.gz: 23c9c047c87264bcba223481c09db29a27cd200cbc045a08f2b3470f355435e9df6945cfdcdf838c532d3e607346e9d0728d64798aa65ae5bb3a6882e9c1cf0c
7
- data.tar.gz: 3561beb0e23d81b779c4834029b215b82336f3faf2c967c55c448d2369b1ea16b1af1bb4d5f34696ab465ec9accecd096ff8578026559614752e31cb4df7436a
6
+ metadata.gz: e06038b32b2c2d24656c6365332d04db7550b9086e402cf735d3de44684a96bd22fc72186cc7f539d6f9379fe12a7666df5e9fd6ab457092bace63377609c9cd
7
+ data.tar.gz: ce90c7ad9fa0232333b8595b8d4d15e1230c5c0119a0332383d37aeb98277a1f57407ba4c2eb8e07c85ef0b8da8fd95011fc92f093b6af5476eb4fe71722cc2f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## Current release (in development)
2
2
 
3
+ ## 0.2.2 [2026-03-09]
4
+
5
+ * Expose and display total number of file differences.
6
+
7
+ *Kevin Murphy*
8
+
3
9
  ## 0.2.1 [2026-03-08]
4
10
 
5
11
  * Increase Glamour line width word wrap.
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]/simplecov-compare/blob/main/CODE_OF_CONDUCT.md).
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
  | --------- | ----- | ---- | -- |
@@ -42,6 +42,10 @@ module Simplecov
42
42
  !file_differences.empty?
43
43
  end
44
44
 
45
+ def num_file_differences
46
+ file_differences.size
47
+ end
48
+
45
49
  private
46
50
 
47
51
  def compare
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Simplecov
4
4
  module Compare
5
- VERSION = "0.2.1"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
@@ -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
@@ -12,7 +12,7 @@ describe Simplecov::Compare do
12
12
 
13
13
  Coverage increased 66.67 points from 0.0% to 66.67%.
14
14
 
15
- ## File Differences
15
+ ## File Differences (3)
16
16
 
17
17
  | File Name | Delta | From | To |
18
18
  | --------- | ----- | ---- | -- |
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplecov-compare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Murphy