covered 0.10.4 → 0.10.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/covered/policy.rb +8 -8
- data/lib/covered/source.rb +1 -13
- data/lib/covered/statistics.rb +2 -0
- data/lib/covered/version.rb +1 -1
- data/lib/covered/wrapper.rb +0 -4
- 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: 3e3b91d1e1b95b11caade1f15c09cff1e0e9e0d198f7b742fd46ff59b465e83f
|
4
|
+
data.tar.gz: d367447379742fee41271f512b9e9b0388c53655ecc985c167ba58b0defdd7b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0926c0a0b461e11dd6a4abf83c24dd5c0250241c607aabd114fdb20aae3a1fae1e4d4b96483cc8be68a20053eb48d761e5a5b3b99fd5a4ea44a1890a8ac496dc'
|
7
|
+
data.tar.gz: 3d69f523f37c5591a07aa8f0d51eb26bb6c1884efb859c3be203fe31d28811bd959c9befa1df2e6275ace7382cee4adc63dabac6befcfc51a22a0c3e4477d754
|
data/README.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
Covered uses modern Ruby features to generate comprehensive coverage, including support for templates which are compiled into Ruby.
|
4
4
|
|
5
|
+
- Incremental coverage - if you run your full test suite, and the run a subset, it will still report the correct coverage - so you can incrementally work on improving coverage.
|
6
|
+
- Integration with RSpec, Minitest, Travis & Coveralls - no need to configure anything - out of the box support for these platforms.
|
7
|
+
- Supports coverage of views - templates compiled to Ruby code can be tracked for coverage reporting.
|
8
|
+
|
5
9
|
![Screenshot](media/example.png)
|
6
10
|
|
7
11
|
## Motivation
|
data/lib/covered/policy.rb
CHANGED
@@ -98,20 +98,20 @@ module Covered
|
|
98
98
|
@name = name
|
99
99
|
end
|
100
100
|
|
101
|
-
def
|
101
|
+
def new
|
102
102
|
begin
|
103
103
|
klass = Covered.const_get(@name)
|
104
104
|
rescue NameError
|
105
105
|
require_relative @name.downcase
|
106
106
|
end
|
107
107
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
108
|
+
klass = Covered.const_get(@name)
|
109
|
+
|
110
|
+
return klass.new
|
111
|
+
end
|
112
|
+
|
113
|
+
def call(*args)
|
114
|
+
self.new.call(*args)
|
115
115
|
end
|
116
116
|
|
117
117
|
def to_s
|
data/lib/covered/source.rb
CHANGED
@@ -28,24 +28,12 @@ require 'parser/current'
|
|
28
28
|
module Covered
|
29
29
|
# The source map, loads the source file, parses the AST to generate which lines contain executable code.
|
30
30
|
class Source < Wrapper
|
31
|
-
|
32
|
-
|
33
|
-
# Deviate from the standard policy above, because all the files are already loaded, so we skip NODE_FCALL.
|
34
|
-
DOGFOOD = /(^V?CALL|.VAR|.ASGN|DEFN)/.freeze
|
35
|
-
|
36
|
-
# Ruby trace points don't trigger for argument execution.
|
37
|
-
# Constants are loaded when the file loads, so they are less interesting.
|
38
|
-
IGNORE = /(ARGS|CDECL)/.freeze
|
39
|
-
|
40
|
-
def initialize(output, executable: EXECUTABLE, ignore: IGNORE)
|
31
|
+
def initialize(output)
|
41
32
|
super(output)
|
42
33
|
|
43
34
|
@paths = {}
|
44
35
|
@mutex = Mutex.new
|
45
36
|
|
46
|
-
@executable = executable
|
47
|
-
@ignore = ignore
|
48
|
-
|
49
37
|
@annotations = {}
|
50
38
|
end
|
51
39
|
|
data/lib/covered/statistics.rb
CHANGED
@@ -48,6 +48,8 @@ module Covered
|
|
48
48
|
|
49
49
|
def print(output)
|
50
50
|
output.puts "* #{count} files checked; #{executed_count}/#{executable_count} lines executed; #{percentage.to_f.round(2)}% covered."
|
51
|
+
|
52
|
+
# Could output funny message here, especially for 100% coverage.
|
51
53
|
end
|
52
54
|
end
|
53
55
|
end
|
data/lib/covered/version.rb
CHANGED
data/lib/covered/wrapper.rb
CHANGED