Skip to content

Commit

Permalink
Merge pull request #400 from amatsuda/warning
Browse files Browse the repository at this point in the history
"warning: global variable `$ERROR_INFO' not initialized"
  • Loading branch information
amatsuda committed Aug 27, 2015
2 parents 76ab9c2 + 8e598ac commit 0d85bd0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Style/SpecialGlobalVars:
Exclude:
- 'spec/deleted_source_spec.rb'
- 'spec/return_codes_spec.rb'
- 'lib/simplecov/defaults.rb'

Style/StringLiterals:
EnforcedStyle: double_quotes
Expand Down
4 changes: 2 additions & 2 deletions lib/simplecov/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
# If we are in a different process than called start, don't interfere.
next if SimpleCov.pid != Process.pid

if $ERROR_INFO # was an exception thrown?
if $! # was an exception thrown?
# if it was a SystemExit, use the accompanying status
# otherwise set a non-zero status representing termination by some other exception
# (see github issue 41)
@exit_status = $ERROR_INFO.is_a?(SystemExit) ? $ERROR_INFO.status : SimpleCov::ExitCodes::EXCEPTION
@exit_status = $!.is_a?(SystemExit) ? $!.status : SimpleCov::ExitCodes::EXCEPTION
else
# Store the exit status of the test run since it goes away after calling the at_exit proc...
@exit_status = SimpleCov::ExitCodes::SUCCESS
Expand Down

3 comments on commit 0d85bd0

@xaviershay
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@colszowka would you be able to push out a new gem release including this fix?

@colszowka
Copy link
Collaborator

@colszowka colszowka commented on 0d85bd0 Nov 28, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xaviershay
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I did forget :) Let me try to do it then, verify it works.

Please sign in to comment.