deep-cover 0.1.15 → 0.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/.rspec_all +3 -0
- data/.travis.yml +5 -3
- data/Rakefile +7 -0
- data/lib/deep_cover/analyser/base.rb +3 -4
- data/lib/deep_cover/analyser/branch.rb +1 -1
- data/lib/deep_cover/analyser/per_char.rb +1 -1
- data/lib/deep_cover/analyser/per_line.rb +1 -1
- data/lib/deep_cover/analyser/statement.rb +1 -1
- data/lib/deep_cover/cli/deep_cover.rb +3 -3
- data/lib/deep_cover/coverage.rb +7 -2
- data/lib/deep_cover/node/arguments.rb +0 -1
- data/lib/deep_cover/node/mixin/execution_location.rb +1 -0
- data/lib/deep_cover/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e164c802351be75ed8094fb9fe6d2a93d2928ccc
|
4
|
+
data.tar.gz: 5ec49dbb3275309c8585dc2ae919c75ac36b4cfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f38996b4c6804ea7f56e7ae31254ef741607684b48bcecb22bfc37d42a68a8ebc7f2e635e14f2d7ab77b42c6eed959f4eac6419d0e37841bd1d66fc3f9442a88
|
7
|
+
data.tar.gz: 06fa0ffb32772c5c6303acee40999336920f743ee9eef3202bd66006de5e1dc46077666f41dce453e97b563ec9fa46a47e27d36595c1df5028df643a01bb5b08
|
data/.rspec
CHANGED
data/.rspec_all
ADDED
data/.travis.yml
CHANGED
data/Rakefile
CHANGED
@@ -8,7 +8,14 @@ RuboCop::RakeTask.new
|
|
8
8
|
|
9
9
|
RSpec::Core::RakeTask.new(:spec).tap { |task| task.pattern = 'spec/*_spec.rb, spec/*/*_spec.rb' }
|
10
10
|
|
11
|
+
desc 'Run all tests'
|
12
|
+
RSpec::Core::RakeTask.new('spec:all') do |task|
|
13
|
+
task.pattern = 'spec/*_spec.rb, spec/*/*_spec.rb'
|
14
|
+
task.rspec_opts = '-O .rspec_all'
|
15
|
+
end
|
16
|
+
|
11
17
|
multitask default: RUBY_VERSION > '2.1' ? [:rubocop, :spec] : :spec
|
18
|
+
multitask 'test:all' => RUBY_VERSION > '2.1' ? [:rubocop, 'spec:all'] : 'spec:all'
|
12
19
|
|
13
20
|
namespace :dev do
|
14
21
|
desc 'Setup extra things required to run the spec suite'
|
@@ -20,7 +20,7 @@ module DeepCover
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def node_runs_map
|
23
|
-
each_node.map do |node
|
23
|
+
each_node.map do |node|
|
24
24
|
[node, node_runs(node)]
|
25
25
|
end.to_h
|
26
26
|
end
|
@@ -34,15 +34,14 @@ module DeepCover
|
|
34
34
|
# Yields the node and it's children (within the subset)
|
35
35
|
def each_node(from = covered_code.root, &block)
|
36
36
|
return to_enum(:each_node) unless block_given?
|
37
|
-
children = node_children(from)
|
38
37
|
begin
|
39
|
-
yield from
|
38
|
+
yield from unless from.is_a?(Node::Root)
|
40
39
|
rescue ProblemWithDiagnostic
|
41
40
|
raise
|
42
41
|
rescue StandardError, SystemStackError => e
|
43
42
|
raise ProblemWithDiagnostic.new(covered_code, from.diagnostic_expression, e)
|
44
43
|
end
|
45
|
-
|
44
|
+
node_children(from).each do |child|
|
46
45
|
each_node(child, &block)
|
47
46
|
end
|
48
47
|
end
|
@@ -6,7 +6,7 @@ module DeepCover
|
|
6
6
|
def results
|
7
7
|
disallow_partial = !options.fetch(:allow_partial, true)
|
8
8
|
line_hits = Array.new(covered_code.nb_lines + covered_code.lineno - 1)
|
9
|
-
each_node do |node
|
9
|
+
each_node do |node|
|
10
10
|
next unless (runs = node_runs(node))
|
11
11
|
node.executed_locs.each do |loc|
|
12
12
|
lineno = loc.line - 1
|
@@ -42,6 +42,7 @@ module DeepCover
|
|
42
42
|
o.string '-c', '--command', 'command to run tests', default: 'bundle exec rake'
|
43
43
|
o.bool '--bundle', 'run bundle before the tests', default: true
|
44
44
|
o.bool '--process', 'turn off to only redo the reporting', default: true
|
45
|
+
o.bool '--open', 'open the output coverage', default: false
|
45
46
|
o.separator 'Coverage options'
|
46
47
|
@ignore_uncovered_map = Analyser.optionally_covered.map do |option|
|
47
48
|
default = Config::DEFAULTS[:ignore_uncovered].include?(option)
|
@@ -76,10 +77,9 @@ module DeepCover
|
|
76
77
|
show_help
|
77
78
|
elsif options[:expression]
|
78
79
|
Debugger.new(options[:expression], **options).show
|
79
|
-
elsif (path = menu.arguments.first)
|
80
|
-
InstrumentedCloneReporter.new(path, **options).run
|
81
80
|
else
|
82
|
-
|
81
|
+
path = menu.arguments.first || '.'
|
82
|
+
InstrumentedCloneReporter.new(path, **options).run
|
83
83
|
end
|
84
84
|
end
|
85
85
|
end
|
data/lib/deep_cover/coverage.rb
CHANGED
@@ -59,9 +59,14 @@ module DeepCover
|
|
59
59
|
dir = output_istanbul(**options).dirname
|
60
60
|
unless [nil, '', 'false'].include? output
|
61
61
|
output = File.expand_path(output)
|
62
|
-
html = "--reporter=html --report-dir='#{output}'
|
62
|
+
html = "--reporter=html --report-dir='#{output}'"
|
63
|
+
if options[:open]
|
64
|
+
html += " && open '#{output}/index.html'"
|
65
|
+
else
|
66
|
+
msg = "\nHTML coverage written to: '#{output}/index.html'"
|
67
|
+
end
|
63
68
|
end
|
64
|
-
`cd #{dir} && nyc report --reporter=text #{html}`
|
69
|
+
`cd #{dir} && nyc report --reporter=text #{html}` + msg.to_s
|
65
70
|
end
|
66
71
|
|
67
72
|
def basic_report
|
data/lib/deep_cover/version.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.16
|
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: 2017-11-
|
12
|
+
date: 2017-11-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: parser
|
@@ -218,6 +218,7 @@ extra_rdoc_files: []
|
|
218
218
|
files:
|
219
219
|
- ".gitignore"
|
220
220
|
- ".rspec"
|
221
|
+
- ".rspec_all"
|
221
222
|
- ".rubocop.yml"
|
222
223
|
- ".travis.yml"
|
223
224
|
- CODE_OF_CONDUCT.md
|