Skip to content
Snippets Groups Projects
Commit 5a20968c authored by Mike McQuaid's avatar Mike McQuaid
Browse files

Tweak tests annotations

- Don't skip Git installation tests on generic OS; remove it instead.
- Install Subversion for macOS Subversion tests.
parent 5d265c74
No related branches found
No related tags found
No related merge requests found
......@@ -60,6 +60,14 @@ jobs:
- name: Run brew man
run: brew man --fail-if-changed
- name: Install brew tests dependencies
if: matrix.os == 'macOS-latest'
run: |
brew install subversion
Library/Homebrew/shims/scm/svn --homebrew=print-path
which svn
which svnadmin
- name: Run brew tests
run: |
# brew tests doesn't like world writable directories
......
......@@ -125,17 +125,23 @@ RSpec.configure do |config|
end
config.before(:each, :needs_svn) do
skip "Subversion is not installed." unless quiet_system "#{HOMEBREW_SHIMS_PATH}/scm/svn", "--version"
svn_shim = HOMEBREW_SHIMS_PATH/"scm/svn"
skip "Subversion is not installed." unless quiet_system svn_shim, "--version"
svn_shim_path = Pathname(Utils.popen_read(svn_shim, "--homebrew=print-path").chomp.presence)
svn_paths = PATH.new(ENV["PATH"])
svn_paths.prepend(svn_shim_path.dirname)
if OS.mac?
xcrun_svn = Utils.popen_read("xcrun", "-f", "svn")
svn_paths.append(File.dirname(xcrun_svn)) if $CHILD_STATUS.success? && xcrun_svn.present?
end
svn = which("svn", svn_paths)
skip "svn is not installed." unless svn
svnadmin = which("svnadmin", svn_paths)
skip "Subversion is not installed." if !svn || !svnadmin
skip "svnadmin is not installed." unless svnadmin
ENV["PATH"] = PATH.new(ENV["PATH"])
.append(svn.dirname)
......@@ -143,7 +149,7 @@ RSpec.configure do |config|
end
config.before(:each, :needs_unzip) do
skip "UnZip is not installed." unless which("unzip")
skip "Unzip is not installed." unless which("unzip")
end
config.around do |example|
......
......@@ -149,14 +149,14 @@ describe Utils::Git do
expect { described_class.ensure_installed! }.to raise_error("Git is unavailable")
end
it "installs git" do
skip if ENV["HOMEBREW_TEST_GENERIC_OS"]
unless ENV["HOMEBREW_TEST_GENERIC_OS"]
it "installs git" do
expect(described_class).to receive(:available?).and_return(false)
expect(described_class).to receive(:safe_system).with(HOMEBREW_BREW_FILE, "install", "git").and_return(true)
expect(described_class).to receive(:available?).and_return(true)
expect(described_class).to receive(:available?).and_return(false)
expect(described_class).to receive(:safe_system).with(HOMEBREW_BREW_FILE, "install", "git").and_return(true)
expect(described_class).to receive(:available?).and_return(true)
described_class.ensure_installed!
described_class.ensure_installed!
end
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment