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
ada6a1b0
Commit
ada6a1b0
authored
8 years ago
by
Markus Reiter
Browse files
Options
Downloads
Patches
Plain Diff
Convert `brew link` test to spec.
parent
c7121f6b
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/cmd/link_spec.rb
+56
-0
56 additions, 0 deletions
Library/Homebrew/test/cmd/link_spec.rb
Library/Homebrew/test/link_test.rb
+0
-23
0 additions, 23 deletions
Library/Homebrew/test/link_test.rb
with
56 additions
and
23 deletions
Library/Homebrew/test/cmd/link_spec.rb
0 → 100644
+
56
−
0
View file @
ada6a1b0
describe
"brew link"
,
:integration_test
do
it
"fails when no argument is given"
do
expect
{
brew
"link"
}
.
to
output
(
/This command requires a keg argument/
).
to_stderr
.
and
not_to_output
.
to_stdout
.
and
be_a_failure
end
it
"does not fail if the given Formula is already linked"
do
setup_test_formula
"testball1"
shutup
do
expect
{
brew
"install"
,
"testball1"
}.
to
be_a_success
expect
{
brew
"link"
,
"testball1"
}.
to
be_a_success
end
end
it
"links a given Formula"
do
setup_test_formula
"testball1"
shutup
do
expect
{
brew
"install"
,
"testball1"
}.
to
be_a_success
expect
{
brew
"unlink"
,
"testball1"
}.
to
be_a_success
end
expect
{
brew
"link"
,
"--dry-run"
,
"testball1"
}
.
to
output
(
/Would link/
).
to_stdout
.
and
not_to_output
.
to_stderr
.
and
be_a_success
expect
{
brew
"link"
,
"--dry-run"
,
"--overwrite"
,
"testball1"
}
.
to
output
(
/Would remove/
).
to_stdout
.
and
not_to_output
.
to_stderr
.
and
be_a_success
expect
{
brew
"link"
,
"testball1"
}
.
to
output
(
/Linking/
).
to_stdout
.
and
not_to_output
.
to_stderr
.
and
be_a_success
end
it
"refuses to link keg-only Formulae"
do
setup_test_formula
"testball1"
,
<<-
EOS
.
undent
keg_only "just because"
EOS
shutup
do
expect
{
brew
"install"
,
"testball1"
}.
to
be_a_success
end
expect
{
brew
"link"
,
"testball1"
}
.
to
output
(
/testball1 is keg-only/
).
to_stderr
.
and
output
(
/Note that doing so can interfere with building software\./
).
to_stdout
.
and
be_a_success
end
end
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/link_test.rb
deleted
100644 → 0
+
0
−
23
View file @
c7121f6b
require
"testing_env"
class
IntegrationCommandTestLink
<
IntegrationCommandTestCase
def
test_link
assert_match
"This command requires a keg argument"
,
cmd_fail
(
"link"
)
setup_test_formula
"testball1"
cmd
(
"install"
,
"testball1"
)
cmd
(
"link"
,
"testball1"
)
cmd
(
"unlink"
,
"testball1"
)
assert_match
"Would link"
,
cmd
(
"link"
,
"--dry-run"
,
"testball1"
)
assert_match
"Would remove"
,
cmd
(
"link"
,
"--dry-run"
,
"--overwrite"
,
"testball1"
)
assert_match
"Linking"
,
cmd
(
"link"
,
"testball1"
)
setup_test_formula
"testball2"
,
<<-
EOS
.
undent
keg_only "just because"
EOS
cmd
(
"install"
,
"testball2"
)
assert_match
"testball2 is keg-only"
,
cmd
(
"link"
,
"testball2"
)
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