brew/Library/Homebrew/test/lib/integration_mocks.rb
Baptiste Fontaine 115e6b49bc tests: monkey-patch exec to get coverage reports
Closes Homebrew/homebrew#48923.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-02-07 11:52:26 +01:00

18 lines
418 B
Ruby

module Homebrew
module Diagnostic
class Checks
def check_integration_test
"This is an integration test" if ENV["HOMEBREW_INTEGRATION_TEST"]
end
end
end
def exec(*args)
if ENV["HOMEBREW_TESTS_COVERAGE"] && ENV["HOMEBREW_INTEGRATION_TEST"]
# Ensure we get coverage results before replacing the current process.
SimpleCov.result
end
Kernel.exec(*args)
end
end