diff options
| author | Mike McQuaid | 2016-07-16 21:03:12 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2016-07-27 15:05:42 -0600 |
| commit | 9f74ca80af828196ea9c5f23dcd5ffd81817927d (patch) | |
| tree | 4cc23c254108f0301219dc0e89e09dd703fe1fc2 /Library/Homebrew/test | |
| parent | 0e25fc01430ae10cc5638d9b0ae9c1784821d2c0 (diff) | |
| download | brew-9f74ca80af828196ea9c5f23dcd5ffd81817927d.tar.bz2 | |
diagnostic: port to generic layer.
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/test_diagnostic.rb | 26 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_os_mac_diagnostic.rb | 41 |
2 files changed, 41 insertions, 26 deletions
diff --git a/Library/Homebrew/test/test_diagnostic.rb b/Library/Homebrew/test/test_diagnostic.rb index 0e0d110e7..2974b0590 100644 --- a/Library/Homebrew/test/test_diagnostic.rb +++ b/Library/Homebrew/test/test_diagnostic.rb @@ -44,19 +44,6 @@ 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 @@ -163,14 +150,6 @@ class DiagnosticChecksTest < Homebrew::TestCase end end - def test_check_for_unsupported_curl_vars - MacOS.stubs(:version).returns OS::Mac::Version.new("10.10") - ENV["SSL_CERT_DIR"] = "/some/path" - - assert_match "SSL_CERT_DIR support was removed from Apple's curl.", - @checks.check_for_unsupported_curl_vars - end - def test_check_for_config_scripts mktmpdir do |path| file = "#{path}/foo-config" @@ -226,9 +205,4 @@ class DiagnosticChecksTest < Homebrew::TestCase end end end - - def test_check_for_beta_xquartz - MacOS::XQuartz.stubs(:version).returns("2.7.10_beta2") - assert_match "The following beta release of XQuartz is installed: 2.7.10_beta2", @checks.check_for_beta_xquartz - end end diff --git a/Library/Homebrew/test/test_os_mac_diagnostic.rb b/Library/Homebrew/test/test_os_mac_diagnostic.rb new file mode 100644 index 000000000..a52179ac6 --- /dev/null +++ b/Library/Homebrew/test/test_os_mac_diagnostic.rb @@ -0,0 +1,41 @@ +require "testing_env" +require "fileutils" +require "pathname" +require "diagnostic" + +class OSMacDiagnosticChecksTest < Homebrew::TestCase + def setup + @env = ENV.to_hash + @checks = Homebrew::Diagnostic::Checks.new + end + + def teardown + ENV.replace(@env) + 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_for_unsupported_curl_vars + MacOS.stubs(:version).returns OS::Mac::Version.new("10.10") + ENV["SSL_CERT_DIR"] = "/some/path" + + assert_match "SSL_CERT_DIR support was removed from Apple's curl.", + @checks.check_for_unsupported_curl_vars + end + + def test_check_for_beta_xquartz + MacOS::XQuartz.stubs(:version).returns("2.7.10_beta2") + assert_match "The following beta release of XQuartz is installed: 2.7.10_beta2", @checks.check_for_beta_xquartz + end +end |
