From 8a8fc68264f2f5a0754048bb38554d4a1b38e9af Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 8 Oct 2019 17:39:31 +0100 Subject: [PATCH] Ruby 2.6.3 brew tests fixes --- Library/Homebrew/system_command.rb | 2 +- .../bottles/testball_bottle-0.1.catalina.bottle.tar.gz | 1 + .../support/helper/spec/shared_context/integration_test.rb | 3 +-- Library/Homebrew/test/system_command_spec.rb | 4 ++-- Library/Homebrew/test/unpack_strategy/subversion_spec.rb | 5 ++--- 5 files changed, 7 insertions(+), 8 deletions(-) create mode 120000 Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.catalina.bottle.tar.gz diff --git a/Library/Homebrew/system_command.rb b/Library/Homebrew/system_command.rb index ec99b832bd..e524359a10 100644 --- a/Library/Homebrew/system_command.rb +++ b/Library/Homebrew/system_command.rb @@ -96,7 +96,7 @@ class SystemCommand return [] if set_variables.empty? - ["env", *set_variables] + ["/usr/bin/env", *set_variables] end def sudo_prefix diff --git a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.catalina.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.catalina.bottle.tar.gz new file mode 120000 index 0000000000..3e989830ba --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.catalina.bottle.tar.gz @@ -0,0 +1 @@ +testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file diff --git a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb index 6ce53e97f4..b61a0b0c14 100644 --- a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb +++ b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb @@ -47,8 +47,7 @@ RSpec.shared_context "integration test" do example.run ensure - FileUtils.rm HOMEBREW_PREFIX/"bin/brew" - FileUtils.rmdir HOMEBREW_PREFIX/"bin" + FileUtils.rm_r HOMEBREW_PREFIX/"bin" end end diff --git a/Library/Homebrew/test/system_command_spec.rb b/Library/Homebrew/test/system_command_spec.rb index 63675661a8..a10b4f485a 100644 --- a/Library/Homebrew/test/system_command_spec.rb +++ b/Library/Homebrew/test/system_command_spec.rb @@ -23,7 +23,7 @@ describe SystemCommand do it "includes the given variables explicitly" do expect(Open3) .to receive(:popen3) - .with(an_instance_of(Hash), ["env", "env"], "A=1", "B=2", "C=3", "env", *env_args, {}) + .with(an_instance_of(Hash), ["/usr/bin/env", "/usr/bin/env"], "A=1", "B=2", "C=3", "env", *env_args, {}) .and_call_original command.run! @@ -49,7 +49,7 @@ describe SystemCommand do expect(Open3) .to receive(:popen3) .with(an_instance_of(Hash), ["/usr/bin/sudo", "/usr/bin/sudo"], "-E", "--", - "env", "A=1", "B=2", "C=3", "env", *env_args, {}) + "/usr/bin/env", "A=1", "B=2", "C=3", "env", *env_args, {}) .and_wrap_original do |original_popen3, *_, &block| original_popen3.call("true", &block) end diff --git a/Library/Homebrew/test/unpack_strategy/subversion_spec.rb b/Library/Homebrew/test/unpack_strategy/subversion_spec.rb index dc818221b4..74c4c80ad4 100644 --- a/Library/Homebrew/test/unpack_strategy/subversion_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/subversion_spec.rb @@ -8,9 +8,8 @@ describe UnpackStrategy::Subversion, :needs_svn do let(:path) { working_copy } before do - system "svnadmin", "create", repo - - system "svn", "checkout", "file://#{repo}", working_copy + safe_system "xcrun", "svnadmin", "create", repo + safe_system "svn", "checkout", "file://#{repo}", working_copy FileUtils.touch working_copy/"test" system "svn", "add", working_copy/"test"