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: c76dedeaddccb806778b5846c3587233919f1d78088edde15bb7b61681013896
4
- data.tar.gz: 387c79384703dd5e92dddf31995982539a233094c7b985ad2977ff1265b2c16c
3
+ metadata.gz: 586f281d9b8b4157c5601d0cd94dcb1908a1111c31d931cfc68f3b853822eb08
4
+ data.tar.gz: 4b2f7f9d3cf128ca9e86c6f381a57ad53171bce4546ff343a2f43b45f55cb49d
5
5
  SHA512:
6
- metadata.gz: 8d80b6d4abe2d40414c5dbc84652c1c4161a5b1d439b79e232414a1cbfbab1f27c51cf11e4d00a940309a01d5813ef59b4d88e57374ba1ce8ef81725b56b0c6a
7
- data.tar.gz: 8bb2180c520a7b8b1c9dcecb191b68fc3c4be7c68c65cd2b4b5bc1ec6f8a40102f069cba5d0e4edebdd28753631657a4f50eb3886b6cbc1bde74c5cee293f70b
6
+ metadata.gz: 4b41851ceba11230c87053d32fd04a09fbc3bd727236e2a065a34e7f49e71c05cab2d2695fc8f1b0d7ff24a13942cacbc5d81a26fdd7a6c501e057c899d67aa5
7
+ data.tar.gz: c9c530386fa430a5b0a5252aa1a0950cbd093e20f4983134643d8e2c86cdb5aa21ffa11e8afeca2ff2af7a31dbad0d5cbdd76f427990b5fb8e4e3d94edc2768c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- solargraph_test_coverage (0.2.4)
4
+ solargraph_test_coverage (0.2.5)
5
5
  solargraph (~> 0.40, > 0.40)
6
6
 
7
7
  GEM
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
- - line
37
- - branch
38
- - test_failing
39
- - test_missing
36
+ - line
37
+ - branch
38
+ - test_failing
39
+ - test_missing
40
40
  exclude_paths:
41
- - 'app/controller'
42
- - 'concerns'
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolargraphTestCoverage
4
- VERSION = '0.2.5'
4
+ VERSION = '0.2.6'
5
5
  end
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.5
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-09 00:00:00.000000000 Z
11
+ date: 2021-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solargraph