simplecov 0.21.1 → 0.21.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: afc0e78d256ce0dd4b33c55efb46a4463f31b72a6dcaefea8dba983ba366f7ba
4
- data.tar.gz: d0c17198c79fe4e85ec21497355e618048637595b00fbecf180ab61815e75c65
3
+ metadata.gz: 4e5385d84c9f26fc48afe9fb5b4883d431a7f346c116ea21ca7b65a744e19db8
4
+ data.tar.gz: 78f2089648f1167fac351d819c7eb7579ae4a4cae323882a2b56f245481296e7
5
5
  SHA512:
6
- metadata.gz: b6cd1717e5c3a639b6f4392e4067625d700aa9732c56898f3be5d9bf9c633715455efaecaf421e53e6c4c734756992ac623ba341a2b78fdc30d0ec56ed27e76f
7
- data.tar.gz: c031ee7dfe0317d5e6536fb4cf393a8bf3dca3c691bb4ab3240678a253a6f514bccf544a0767291959d671581329399f6e1993ead0660fa5875980e6c0862114
6
+ metadata.gz: 071375d821a918217c1318bca354dde933d04c572761c247ecb77f976b8085a489d3dfe7463994b88705685f1c0f5d1e7861d79df0f949935982f45e342ad862
7
+ data.tar.gz: ca85cde65a7f2f6987be16d542e571312cd763f6fadca1ebcc1f44be7a7fc70f7375ba79a3afe44c893f4db118fd6e6ef81292e858f962647df19defa80f0ebc
@@ -1,3 +1,11 @@
1
+ 0.21.2 (2021-01-09)
2
+ ==========
3
+
4
+ ## Bugfixes
5
+ * `maximum_coverage_drop` won't fail any more if `.last_run.json` is still in the old format. Thanks [@petertellgren](https://github.com/petertellgren)
6
+ * `maximum_coverage_drop` won't fail if an expectation is specified for a previous unrecorded criterion, it will just pass (there's nothing, so nothing to drop)
7
+ * fixed bug in `maximum_coverage_drop` calculation that could falsely report it had dropped for minimal differences
8
+
1
9
  0.21.1 (2021-01-04)
2
10
  ==========
3
11
 
@@ -51,22 +51,32 @@ module SimpleCov
51
51
  {
52
52
  criterion: criterion,
53
53
  max_drop: percent,
54
- drop_percent: last_coverage(criterion) -
55
- SimpleCov.round_coverage(
56
- result.coverage_statistics.fetch(criterion).percent
57
- )
54
+ drop_percent: drop_percent(criterion)
58
55
  }
59
56
  end
60
57
  end
61
58
 
59
+ # if anyone says "max_coverage_drop 0.000000000000000001" I appologize. Please don't.
60
+ MAX_DROP_ACCURACY = 10
61
+ def drop_percent(criterion)
62
+ drop = last_coverage(criterion) -
63
+ SimpleCov.round_coverage(
64
+ result.coverage_statistics.fetch(criterion).percent
65
+ )
66
+
67
+ # floats, I tell ya.
68
+ # irb(main):001:0* 80.01 - 80.0
69
+ # => 0.010000000000005116
70
+ drop.floor(MAX_DROP_ACCURACY)
71
+ end
72
+
62
73
  def last_coverage(criterion)
63
74
  last_coverage_percent = last_run[:result][criterion]
64
75
 
65
- if !last_coverage_percent && criterion == "line"
66
- last_run[:result][:covered_percent]
67
- else
68
- last_coverage_percent
69
- end
76
+ # fallback for old file format
77
+ last_coverage_percent = last_run[:result][:covered_percent] if !last_coverage_percent && criterion == :line
78
+
79
+ last_coverage_percent || 0
70
80
  end
71
81
  end
72
82
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SimpleCov
4
- VERSION = "0.21.1"
4
+ VERSION = "0.21.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplecov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.1
4
+ version: 0.21.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christoph Olszowka
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-01-04 00:00:00.000000000 Z
12
+ date: 2021-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: docile
@@ -116,9 +116,9 @@ licenses:
116
116
  metadata:
117
117
  bug_tracker_uri: https://github.com/simplecov-ruby/simplecov/issues
118
118
  changelog_uri: https://github.com/simplecov-ruby/simplecov/blob/main/CHANGELOG.md
119
- documentation_uri: https://www.rubydoc.info/gems/simplecov/0.21.1
119
+ documentation_uri: https://www.rubydoc.info/gems/simplecov/0.21.2
120
120
  mailing_list_uri: https://groups.google.com/forum/#!forum/simplecov
121
- source_code_uri: https://github.com/simplecov-ruby/simplecov/tree/v0.21.1
121
+ source_code_uri: https://github.com/simplecov-ruby/simplecov/tree/v0.21.2
122
122
  post_install_message:
123
123
  rdoc_options: []
124
124
  require_paths: