-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Fix coverage collection due to SimpleCov load timing (#122)
- Loading branch information
Showing
5 changed files
with
77 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# (The MIT License) | ||
# Copyright (c) 2012 Chad Humphries, David Chelimsky, Myron Marston | ||
# Copyright (c) 2009 Chad Humphries, David Chelimsky | ||
# Copyright (c) 2006 David Chelimsky, The RSpec Development Team | ||
# Copyright (c) 2005 Steven Baker | ||
|
||
require 'rspec/core' | ||
RSpec::Core::Runner.invoke |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# (The MIT License) | ||
# Copyright (c) 2012 Chad Humphries, David Chelimsky, Myron Marston | ||
# Copyright (c) 2009 Chad Humphries, David Chelimsky | ||
# Copyright (c) 2006 David Chelimsky, The RSpec Development Team | ||
# Copyright (c) 2005 Steven Baker | ||
|
||
# Turn on verbose to make sure we not generating any ruby warning | ||
$VERBOSE = true | ||
|
||
# So our "did they run the rspec command?" detection logic thinks | ||
# that we run `rspec`. | ||
$0 = 'rspec' | ||
|
||
# This is necessary for when `--standalone` is being used. | ||
$:.unshift File.expand_path '../bundle', __dir__ | ||
|
||
# For the travis build we put the bundle directory up a directory | ||
# so it can be shared among the repos for faster bundle installs. | ||
$:.unshift File.expand_path '../../bundle', __dir__ | ||
|
||
require 'bundler/setup' | ||
|
||
# To use simplecov while running rspec-core's test suite, we must | ||
# load simplecov _before_ loading any of rspec-core's files. | ||
# So, this executable exists purely as a wrapper script that | ||
# first loads simplecov, and then loads rspec. | ||
begin | ||
# Simplecov emits some ruby warnings when loaded, so silence them. | ||
old_verbose = $VERBOSE | ||
$VERBOSE = false | ||
|
||
unless ENV['COVERAGE'] && ENV['COVERAGE'].empty? || RUBY_VERSION < '1.9.3' | ||
require 'simplecov' | ||
|
||
SimpleCov.start do | ||
add_filter './bundle/' | ||
add_filter './tmp/' | ||
add_filter './spec/' | ||
minimum_coverage(RUBY_PLATFORM == 'java' ? 94 : 97) | ||
end | ||
end | ||
rescue LoadError | ||
ensure | ||
$VERBOSE = old_verbose | ||
end | ||
|
||
load File.expand_path('rspec', __dir__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters