From 7b9fd538fabf450203c0120f996403e24bd02071 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 7 Nov 2016 00:01:57 +0100 Subject: Move `integration_mocks` to `test/support/helper`. --- .../support/helper/integration_command_test_case.rb | 3 ++- .../Homebrew/test/support/helper/integration_mocks.rb | 17 +++++++++++++++++ Library/Homebrew/test/support/lib/integration_mocks.rb | 17 ----------------- 3 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 Library/Homebrew/test/support/helper/integration_mocks.rb delete mode 100644 Library/Homebrew/test/support/lib/integration_mocks.rb (limited to 'Library') diff --git a/Library/Homebrew/test/support/helper/integration_command_test_case.rb b/Library/Homebrew/test/support/helper/integration_command_test_case.rb index d7ae67423..9306617eb 100644 --- a/Library/Homebrew/test/support/helper/integration_command_test_case.rb +++ b/Library/Homebrew/test/support/helper/integration_command_test_case.rb @@ -60,6 +60,7 @@ class IntegrationCommandTestCase < Homebrew::TestCase cmd_args = %W[ -W0 -I#{HOMEBREW_LIBRARY_PATH}/test/support/lib + -I#{HOMEBREW_LIBRARY_PATH} -rconfig ] if ENV["HOMEBREW_TESTS_COVERAGE"] @@ -70,7 +71,7 @@ class IntegrationCommandTestCase < Homebrew::TestCase cmd_args << "-rbundler/setup" cmd_args << "-rsimplecov" end - cmd_args << "-rintegration_mocks" + cmd_args << "-rtest/support/helper/integration_mocks" cmd_args << (HOMEBREW_LIBRARY_PATH/"brew.rb").resolved_path.to_s cmd_args += args developer = ENV["HOMEBREW_DEVELOPER"] diff --git a/Library/Homebrew/test/support/helper/integration_mocks.rb b/Library/Homebrew/test/support/helper/integration_mocks.rb new file mode 100644 index 000000000..6effb0cde --- /dev/null +++ b/Library/Homebrew/test/support/helper/integration_mocks.rb @@ -0,0 +1,17 @@ +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 diff --git a/Library/Homebrew/test/support/lib/integration_mocks.rb b/Library/Homebrew/test/support/lib/integration_mocks.rb deleted file mode 100644 index 6effb0cde..000000000 --- a/Library/Homebrew/test/support/lib/integration_mocks.rb +++ /dev/null @@ -1,17 +0,0 @@ -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 -- cgit v1.2.3