aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/test_diagnostic.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_diagnostic.rb b/Library/Homebrew/test/test_diagnostic.rb
index c4b61e917..8aa2c6f67 100644
--- a/Library/Homebrew/test/test_diagnostic.rb
+++ b/Library/Homebrew/test/test_diagnostic.rb
@@ -13,6 +13,13 @@ class DiagnosticChecksTest < Homebrew::TestCase
ENV.replace(@env)
end
+ def test_inject_file_list
+ assert_equal "foo:\n",
+ @checks.inject_file_list([], "foo:\n")
+ assert_equal "foo:\n /a\n /b\n",
+ @checks.inject_file_list(%w[/a /b], "foo:\n")
+ end
+
def test_check_path_for_trailing_slashes
ENV["PATH"] += File::PATH_SEPARATOR + "/foo/bar/"
assert_match "Some directories in your path end in a slash",
@@ -37,6 +44,19 @@ class DiagnosticChecksTest < Homebrew::TestCase
end
end
+ def test_check_for_other_package_managers
+ MacOS.stubs(:macports_or_fink).returns ["fink"]
+ assert_match "You have MacPorts or Fink installed:",
+ @checks.check_for_other_package_managers
+ end
+
+ def test_check_for_unsupported_osx
+ ARGV.stubs(:homebrew_developer?).returns false
+ OS::Mac.stubs(:prerelease?).returns true
+ assert_match "We do not provide support for this pre-release version.",
+ @checks.check_for_unsupported_osx
+ end
+
def test_check_access_homebrew_repository
mod = HOMEBREW_REPOSITORY.stat.mode & 0777
HOMEBREW_REPOSITORY.chmod 0555