deep-cover 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a96f4b2116f94cd125968ce00c3edd4b2a6b75dfc2396cb3bbf9233db0c5e44e
4
- data.tar.gz: b165c1ca631f9864237bba5b0d8ffeb5cda25dc32cf476c88646947491dc6a68
3
+ metadata.gz: f2b3fc6dc22a4c501fd7090466901a9174a9ed0a782218970d1c23bcacb9ea56
4
+ data.tar.gz: 4ea988ee9e3feea82db9df67cf3da0dd4d44229fb233becbff97953e4833730e
5
5
  SHA512:
6
- metadata.gz: 7291cc14d9b2e73373a85d699a82ce5104a4a62ca32e16cb8fae12216e97cca80e7da87c19175c49ae6bdab70b6427759ca9d84115f46f1f4f26b9fe4a020332
7
- data.tar.gz: e22d72ae1e3167b46a2575453a45049931b743d4f0723fa0c793e76cde316a473ad740067f4094afb8f5a16628d6c8caaaaacf3de88614de40f5897a6f84d993
6
+ metadata.gz: 5c0737e921cdc4c6cd4cb4461bb2f7bdd95c4f9b71d0132cda39b6005fd16cd062df45042f8fd0cb7474cf3320281feef60e4903e41d62bf6b5269c344169020
7
+ data.tar.gz: 752569da3e00e55e136f797903e8686e2a6f5fac70050dcc42c525a104d93dd9174ccd11d17b804b83f9b76c645242d6da823a7e879ca4932a81adca23a2cdab
data/README.md CHANGED
@@ -46,7 +46,7 @@ These examples are direct outputs from our HTML reporter:
46
46
  Feature | MRI | DeepCover
47
47
  -------------------|:----------:|:--------:
48
48
  Line coverage | partial | ✓
49
- Statement coverage | no | ✓
49
+ Node coverage | no | ✓
50
50
  Branch coverage | partial | ✓
51
51
  Method coverage | ✓ | ~
52
52
  Slowdown | < 1% | ~20%
@@ -54,7 +54,7 @@ Platform support | Ruby 2.5+ | Ruby 2.1+, JRuby
54
54
 
55
55
  **Line coverage**: MRI doesn't cover some lines (e.g. `when some_value`).
56
56
 
57
- **Statement coverage**: MRI provides no way to tell which parts of any line is evaluated. DeepCover covers everything.
57
+ **Node coverage**: MRI provides no way to tell which parts of any line is evaluated. DeepCover covers everything.
58
58
 
59
59
  **Method coverage**: MRI considers every method defined, including methods defined on objects or via `define_method`, `class_eval`, etc. For Istanbul output, DeepCover has a different approach and covers all `def` and all blocks.
60
60
 
@@ -76,7 +76,7 @@ module DeepCover
76
76
  end
77
77
 
78
78
  def show_char_coverage
79
- output { "\nChar coverage:\n" }
79
+ output { "\nNode coverage:\n" }
80
80
 
81
81
  output { format_char_cover(covered_code, show_whitespace: !!ENV['W'], **options) }
82
82
  end
@@ -55,12 +55,28 @@ module DeepCover
55
55
  end
56
56
  end
57
57
 
58
- # a, b = ...
58
+ # Some multiple assignments are the only cases where Ruby
59
+ # syntax rules won't allow us to insert tracking code
60
+ # where we'd like it to be run.
61
+ #
62
+ # For example:
63
+ #
64
+ # method.a, b, method_2.c = [...]
65
+ #
66
+ # We'd like to add a tracker after the call to `a=` and
67
+ # before the assignment to b and the call to `method_2`.
68
+ #
69
+ # We can't really do this with simple insertions, so
70
+ # we temporarily of strategy for BackwardsStrategy
71
+ #
59
72
  class Masgn < Node
60
73
  class BackwardsNode < Node
61
74
  include BackwardsStrategy
62
75
  end
63
76
 
77
+ # We can't rewrite `self.bar` within a multiple assignment in the
78
+ # case that `bar=` is private, so remain conservative and don't add
79
+ # trackers.
64
80
  class SelfReceiver < BackwardsNode
65
81
  executed_loc_keys :expression
66
82
  end
@@ -73,8 +89,7 @@ module DeepCover
73
89
  has_tracker :entry
74
90
  has_child actual_receiver: Node
75
91
  def rewrite
76
- # The local=local is to avoid Ruby warning about "Possible use of value in void context"
77
- '(%{local} = (%{node});%{entry_tracker}; %{local}=%{local})'
92
+ '(%{entry_tracker};%{node})'
78
93
  end
79
94
  alias_method :flow_entry_count, :entry_tracker_hits
80
95
  end
@@ -105,6 +120,10 @@ module DeepCover
105
120
  }
106
121
  end
107
122
  end
123
+
124
+ def execution_count
125
+ receiver.flow_completion_count
126
+ end
108
127
  end
109
128
 
110
129
  class ConstantScopeWrapper < Node
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeepCover
4
- VERSION = '0.5.6'
4
+ VERSION = '0.5.7'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deep-cover
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc-André Lafortune
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-06-01 00:00:00.000000000 Z
12
+ date: 2018-06-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: parser