solargraph_test_coverage 0.2.5 → 0.2.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 586f281d9b8b4157c5601d0cd94dcb1908a1111c31d931cfc68f3b853822eb08
|
4
|
+
data.tar.gz: 4b2f7f9d3cf128ca9e86c6f381a57ad53171bce4546ff343a2f43b45f55cb49d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b41851ceba11230c87053d32fd04a09fbc3bd727236e2a065a34e7f49e71c05cab2d2695fc8f1b0d7ff24a13942cacbc5d81a26fdd7a6c501e057c899d67aa5
|
7
|
+
data.tar.gz: c9c530386fa430a5b0a5252aa1a0950cbd093e20f4983134643d8e2c86cdb5aa21ffa11e8afeca2ff2af7a31dbad0d5cbdd76f427990b5fb8e4e3d94edc2768c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -33,13 +33,13 @@ test_coverage:
|
|
33
33
|
preload_rails: true
|
34
34
|
test_framework: rspec # or minitest
|
35
35
|
coverage:
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
- line
|
37
|
+
- branch
|
38
|
+
- test_failing
|
39
|
+
- test_missing
|
40
40
|
exclude_paths:
|
41
|
-
|
42
|
-
|
41
|
+
- 'app/controller'
|
42
|
+
- 'concerns'
|
43
43
|
```
|
44
44
|
|
45
45
|
|
@@ -51,6 +51,9 @@ And then execute:
|
|
51
51
|
Or install it yourself as:
|
52
52
|
|
53
53
|
$ gem install solargraph_test_coverage
|
54
|
+
|
55
|
+
A note on testing framework:
|
56
|
+
Since both Minitest and RSpec are supported, neither are direct dependencies of this gem. Therefore, you have to have them installed separately either via your bundle or via `gem install`.
|
54
57
|
|
55
58
|
## Usage
|
56
59
|
|
@@ -9,6 +9,12 @@ module SolargraphTestCoverage
|
|
9
9
|
Config.exclude_paths.any? { |path| source_filename.sub(Dir.pwd, '').include? path }
|
10
10
|
end
|
11
11
|
|
12
|
+
def using_debugger?(source)
|
13
|
+
source.code.include?('binding.pry') ||
|
14
|
+
source.code.include?('byebug') ||
|
15
|
+
source.code.include?('debugger')
|
16
|
+
end
|
17
|
+
|
12
18
|
def test_file(source)
|
13
19
|
relative_filepath = source.location.filename.sub(Dir.pwd, '').split('/').reject(&:empty?)
|
14
20
|
relative_filepath[0] = Config.test_dir
|
@@ -6,7 +6,7 @@ module SolargraphTestCoverage
|
|
6
6
|
include ReporterHelpers
|
7
7
|
|
8
8
|
def diagnose(source, _api_map)
|
9
|
-
return [] if source.code.empty? || exclude_file?(source.location.filename)
|
9
|
+
return [] if source.code.empty? || using_debugger?(source) || exclude_file?(source.location.filename)
|
10
10
|
return [test_missing_error(source)] unless File.file?(test_file(source))
|
11
11
|
|
12
12
|
results = run_test(source)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solargraph_test_coverage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Kolkey
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solargraph
|