aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/diagnostic_spec.rb
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-28 14:50:46 +0100
committerMarkus Reiter2017-02-28 15:06:32 +0100
commita5549023804a8cef50f71dc2d7a723be8e83f3d1 (patch)
tree0c5bcf473909f755d209793892a21ce40f6bdd07 /Library/Homebrew/test/diagnostic_spec.rb
parent0457f0d3e2186991c16e2136b12a5ecc034d99da (diff)
downloadbrew-a5549023804a8cef50f71dc2d7a723be8e83f3d1.tar.bz2
Add `mktmpdir` helper method.
Diffstat (limited to 'Library/Homebrew/test/diagnostic_spec.rb')
-rw-r--r--Library/Homebrew/test/diagnostic_spec.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/Library/Homebrew/test/diagnostic_spec.rb b/Library/Homebrew/test/diagnostic_spec.rb
index e749a3b0f..59560127c 100644
--- a/Library/Homebrew/test/diagnostic_spec.rb
+++ b/Library/Homebrew/test/diagnostic_spec.rb
@@ -13,7 +13,7 @@ describe Homebrew::Diagnostic::Checks do
end
specify "#check_for_anaconda" do
- Dir.mktmpdir do |path|
+ mktmpdir do |path|
anaconda = "#{path}/anaconda"
python = "#{path}/python"
FileUtils.touch anaconda
@@ -23,7 +23,7 @@ describe Homebrew::Diagnostic::Checks do
FileUtils.chmod 0755, anaconda
FileUtils.chmod 0755, python
- ENV["PATH"] = path + File::PATH_SEPARATOR + ENV["PATH"]
+ ENV["PATH"] = "#{path}#{File::PATH_SEPARATOR}#{ENV["PATH"]}"
expect(subject.check_for_anaconda).to match("Anaconda")
end
@@ -124,7 +124,7 @@ describe Homebrew::Diagnostic::Checks do
end
specify "#check_user_curlrc" do
- Dir.mktmpdir do |path|
+ mktmpdir do |path|
FileUtils.touch "#{path}/.curlrc"
ENV["CURL_HOME"] = path
@@ -133,7 +133,7 @@ describe Homebrew::Diagnostic::Checks do
end
specify "#check_for_config_scripts" do
- Dir.mktmpdir do |path|
+ mktmpdir do |path|
file = "#{path}/foo-config"
FileUtils.touch file
FileUtils.chmod 0755, file
@@ -153,7 +153,7 @@ describe Homebrew::Diagnostic::Checks do
begin
HOMEBREW_CELLAR.rmtree
- Dir.mktmpdir do |path|
+ mktmpdir do |path|
FileUtils.ln_s path, HOMEBREW_CELLAR
expect(subject.check_for_symlinked_cellar).to match(path)
@@ -170,8 +170,8 @@ describe Homebrew::Diagnostic::Checks do
end
specify "#check_for_external_cmd_name_conflict" do
- Dir.mktmpdir do |path1|
- Dir.mktmpdir do |path2|
+ mktmpdir do |path1|
+ mktmpdir do |path2|
[path1, path2].each do |path|
cmd = "#{path}/brew-foo"
FileUtils.touch cmd