Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
7cc4ca41
Commit
7cc4ca41
authored
8 years ago
by
Markus Reiter
Browse files
Options
Downloads
Patches
Plain Diff
Convert `os/mac/diagnostic` test to spec.
parent
93e2cb31
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Library/Homebrew/test/os/mac/diagnostic_spec.rb
+42
-0
42 additions, 0 deletions
Library/Homebrew/test/os/mac/diagnostic_spec.rb
Library/Homebrew/test/os/mac/diagnostic_test.rb
+0
-45
0 additions, 45 deletions
Library/Homebrew/test/os/mac/diagnostic_test.rb
with
42 additions
and
45 deletions
Library/Homebrew/test/os/mac/diagnostic_spec.rb
0 → 100644
+
42
−
0
View file @
7cc4ca41
require
"diagnostic"
describe
Homebrew
::
Diagnostic
::
Checks
do
specify
"#check_for_other_package_managers"
do
allow
(
MacOS
).
to
receive
(
:macports_or_fink
).
and_return
([
"fink"
])
expect
(
subject
.
check_for_other_package_managers
)
.
to
match
(
"You have MacPorts or Fink installed:"
)
end
specify
"#check_for_unsupported_macos"
do
ENV
.
delete
(
"HOMEBREW_DEVELOPER"
)
allow
(
OS
::
Mac
).
to
receive
(
:prerelease?
).
and_return
(
true
)
expect
(
subject
.
check_for_unsupported_macos
)
.
to
match
(
"We do not provide support for this pre-release version."
)
end
specify
"#check_for_unsupported_curl_vars"
do
allow
(
MacOS
).
to
receive
(
:version
).
and_return
(
OS
::
Mac
::
Version
.
new
(
"10.10"
))
ENV
[
"SSL_CERT_DIR"
]
=
"/some/path"
expect
(
subject
.
check_for_unsupported_curl_vars
)
.
to
match
(
"SSL_CERT_DIR support was removed from Apple's curl."
)
end
specify
"#check_for_beta_xquartz"
do
allow
(
MacOS
::
XQuartz
).
to
receive
(
:version
).
and_return
(
"2.7.10_beta2"
)
expect
(
subject
.
check_for_beta_xquartz
)
.
to
match
(
"The following beta release of XQuartz is installed: 2.7.10_beta2"
)
end
specify
"#check_xcode_8_without_clt_on_el_capitan"
do
allow
(
MacOS
).
to
receive
(
:version
).
and_return
(
OS
::
Mac
::
Version
.
new
(
"10.11"
))
allow
(
MacOS
::
Xcode
).
to
receive
(
:installed?
).
and_return
(
true
)
allow
(
MacOS
::
Xcode
).
to
receive
(
:version
).
and_return
(
"8.0"
)
allow
(
MacOS
::
Xcode
).
to
receive
(
:without_clt?
).
and_return
(
true
)
expect
(
subject
.
check_xcode_8_without_clt_on_el_capitan
)
.
to
match
(
"You have Xcode 8 installed without the CLT"
)
end
end
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/os/mac/diagnostic_test.rb
deleted
100644 → 0
+
0
−
45
View file @
93e2cb31
require
"testing_env"
require
"fileutils"
require
"pathname"
require
"diagnostic"
class
OSMacDiagnosticChecksTest
<
Homebrew
::
TestCase
def
setup
super
@checks
=
Homebrew
::
Diagnostic
::
Checks
.
new
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_macos
ENV
.
delete
(
"HOMEBREW_DEVELOPER"
)
OS
::
Mac
.
stubs
(
:prerelease?
).
returns
true
assert_match
"We do not provide support for this pre-release version."
,
@checks
.
check_for_unsupported_macos
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
def
test_check_xcode_8_without_clt_on_el_capitan
MacOS
.
stubs
(
:version
).
returns
OS
::
Mac
::
Version
.
new
(
"10.11"
)
MacOS
::
Xcode
.
stubs
(
:installed?
).
returns
true
MacOS
::
Xcode
.
stubs
(
:version
).
returns
"8.0"
MacOS
::
Xcode
.
stubs
(
:without_clt?
).
returns
true
assert_match
"You have Xcode 8 installed without the CLT"
,
@checks
.
check_xcode_8_without_clt_on_el_capitan
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment