minitest-cc 0.1.1 → 0.1.2

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: 1c5311d840ff9b9c308e93bc13eecf90f09fe2197dd93435ceb16834cbf8b71f
4
- data.tar.gz: 72be9edd178c3a6993a2102af5fe8f81ec304db9e418e2dfbc2c0de8a7eeaca4
3
+ metadata.gz: 848f6762978bb5db1d4bfb03e13ff466a9fc7111ee1525f5825a558863b026ae
4
+ data.tar.gz: fa59d3d0887831482fb6ea9ce737f841bd326d42808d3c3b89556f914657ba8d
5
5
  SHA512:
6
- metadata.gz: 01236f238a8f18ae1ab175af50a5817ab56249d0e8283ef1c3cb3b06be584231bd468fdfb2dbc3d44b8eeae54dc611d98a7a8944dd2357a6e0846cf5a65df16f
7
- data.tar.gz: 9d721a79a0e163f1467a8e1c11b0fa1abecb5e28c7261f9309553b61bf8b00198d65e16c6b7af396b98ef72b7898910c848860c470cbb9bf9a6e3f5b7d9f0f28
6
+ metadata.gz: ff8cc42c16e7b0baad675f64f275a3435b8f990d43dff8ccca0288888625c3480b4e20584a2dcbb58f231c996ecefcd98609431a00eeaafdeba863afab8c9b96
7
+ data.tar.gz: 469ca5c033d2f4075207cd070758592b2d43248bf212eb0cd395b824b30c67b1a994a13f02d7e0078fb7e4ff12416c9ac8bcb87c1b98231fd37cbb102e844f66
@@ -1,19 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'minitest'
4
-
5
3
  module Minitest
6
4
  module Cc
7
5
  # Reporter class extend of Minitest Reporter
8
- # this get 5 important methods from the parent
9
- # but we use only 2
10
6
  class Reporter < Minitest::AbstractReporter
11
- ##
12
- # Executed in the beginin of the minitest run
13
- def start
14
- Cc.start_coverage
15
- end
16
-
17
7
  ##
18
8
  # Executed in the final of the minitest run
19
9
  def report
@@ -3,6 +3,6 @@
3
3
  module Minitest
4
4
  module Cc
5
5
  # plugin version
6
- VERSION = '0.1.1'
6
+ VERSION = '0.1.2'
7
7
  end
8
8
  end
data/lib/minitest/cc.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'minitest'
4
+
3
5
  require_relative 'cc/version'
4
6
  require_relative 'cc/reporter'
5
7
  require_relative 'cc/file_coverage'
@@ -42,6 +44,7 @@ module Minitest
42
44
  # @see https://runebook.dev/en/docs/ruby/coverage Coverage blog post explaining the use
43
45
  # @see https://ruby-doc.org/stdlib-2.7.6/libdoc/coverage/rdoc/Coverage.html Documentation of the module
44
46
  def start_coverage
47
+ require 'coverage'
45
48
  Coverage.start(coverage_mode.collect { |m| [m, true] }.to_h)
46
49
  end
47
50
 
@@ -54,6 +57,8 @@ module Minitest
54
57
  @files.each { |f| puts f.to_s } if cc_mode == :per_file
55
58
  puts resume if cc_mode == :resume
56
59
  puts
60
+ rescue NameError
61
+ puts "\n\n[!] cc extension is installed but was not started."
57
62
  end
58
63
 
59
64
  ##
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'coverage'
4
- require 'minitest'
5
3
  require 'minitest/cc'
6
4
 
7
5
  # Minitest module
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-cc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - a-chacon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-30 00:00:00.000000000 Z
11
+ date: 2022-07-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Plugin for minitest, provide a minimal information of code coverage
14
14
  to your test output. '