Skip to content

Commit e408619

Browse files
committed
Always define SimpleCov.external_at_exit
See no reason not to, makes it easier and everything that we remove from defaults seems worthwhile.
1 parent 6c0eb5a commit e408619

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/minitest/simplecov_plugin.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# https://github.com/seattlerb/minitest#writing-extensions
55
module Minitest
66
def self.plugin_simplecov_init(_options)
7-
SimpleCov.external_at_exit = true if SimpleCov.respond_to?(:external_at_exit=)
7+
SimpleCov.external_at_exit = true
88

99
Minitest.after_run do
1010
SimpleCov.at_exit_behavior if SimpleCov.respond_to?(:at_exit_behavior)

lib/simplecov.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ class << self
2727
attr_accessor :pid
2828
attr_reader :exit_exception
2929

30+
# Basically, should we take care of at_exit behavior or something else?
31+
# Used by the minitest plugin. See lib/minitest/simplecov_plugin.rb
32+
attr_accessor :external_at_exit
33+
alias external_at_exit? external_at_exit
34+
3035
#
3136
# Sets up SimpleCov to run against your project.
3237
# You can optionally specify a profile to use as well as configuration with a block:

lib/simplecov/defaults.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
# Gotta stash this a-s-a-p, see the CommandGuesser class and i.e. #110 for further info
2222
SimpleCov::CommandGuesser.original_run_command = "#{$PROGRAM_NAME} #{ARGV.join(' ')}"
2323

24-
class << SimpleCov
25-
attr_accessor :external_at_exit
26-
alias external_at_exit? external_at_exit
27-
end
28-
2924
at_exit do
3025
next if SimpleCov.external_at_exit?
3126

0 commit comments

Comments
 (0)