test/subversion: fix subversion paths/detection.
This commit is contained in:
parent
924af100b7
commit
6a33959888
@ -124,8 +124,19 @@ RSpec.configure do |config|
|
||||
end
|
||||
|
||||
config.before(:each, :needs_svn) do
|
||||
homebrew_bin = File.dirname HOMEBREW_BREW_FILE
|
||||
skip "subversion not installed." unless %W[/usr/bin/svn #{homebrew_bin}/svn].map { |x| File.executable?(x) }.any?
|
||||
svn_paths = PATH.new(ENV["PATH"])
|
||||
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)
|
||||
svnadmin = which("svnadmin", svn_paths)
|
||||
skip "subversion not installed." if !svn || !svnadmin
|
||||
|
||||
ENV["PATH"] = PATH.new(ENV["PATH"])
|
||||
.append(svn.dirname)
|
||||
.append(svnadmin.dirname)
|
||||
end
|
||||
|
||||
config.before(:each, :needs_unzip) do
|
||||
|
||||
@ -8,9 +8,7 @@ describe UnpackStrategy::Subversion, :needs_svn do
|
||||
let(:path) { working_copy }
|
||||
|
||||
before do
|
||||
svnadmin = ["svnadmin"]
|
||||
svnadmin = ["xcrun", *svnadmin] if OS.mac? && MacOS.version >= :catalina
|
||||
safe_system(*svnadmin, "create", repo)
|
||||
safe_system "svnadmin", "create", repo
|
||||
safe_system "svn", "checkout", "file://#{repo}", working_copy
|
||||
|
||||
FileUtils.touch working_copy/"test"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user