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
28f707c9
Commit
28f707c9
authored
8 years ago
by
Alyssa Ross
Browse files
Options
Downloads
Patches
Plain Diff
tab: test tap runtime dependencies
parent
41e25209
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/test_tab.rb
+11
-1
11 additions, 1 deletion
Library/Homebrew/test/test_tab.rb
Library/Homebrew/test/testing_env.rb
+1
-1
1 addition, 1 deletion
Library/Homebrew/test/testing_env.rb
with
12 additions
and
2 deletions
Library/Homebrew/test/test_tab.rb
+
11
−
1
View file @
28f707c9
...
@@ -130,9 +130,16 @@ class TabTests < Homebrew::TestCase
...
@@ -130,9 +130,16 @@ class TabTests < Homebrew::TestCase
f
=
formula
do
f
=
formula
do
url
"foo-1.0"
url
"foo-1.0"
depends_on
"bar"
depends_on
"bar"
depends_on
"user/repo/from_tap"
depends_on
"baz"
=>
:build
depends_on
"baz"
=>
:build
end
end
tap
=
Tap
.
new
(
"user"
,
"repo"
)
from_tap
=
formula
(
"from_tap"
,
tap
.
path
/
"Formula/from_tap.rb"
)
do
url
"from_tap-1.0"
end
stub_formula_loader
from_tap
stub_formula_loader
formula
(
"bar"
)
{
url
"bar-2.0"
}
stub_formula_loader
formula
(
"bar"
)
{
url
"bar-2.0"
}
stub_formula_loader
formula
(
"baz"
)
{
url
"baz-3.0"
}
stub_formula_loader
formula
(
"baz"
)
{
url
"baz-3.0"
}
...
@@ -140,7 +147,10 @@ class TabTests < Homebrew::TestCase
...
@@ -140,7 +147,10 @@ class TabTests < Homebrew::TestCase
stdlib
=
:libcxx
stdlib
=
:libcxx
tab
=
Tab
.
create
(
f
,
compiler
,
stdlib
)
tab
=
Tab
.
create
(
f
,
compiler
,
stdlib
)
runtime_dependencies
=
[{
"full_name"
=>
"bar"
,
"version"
=>
"2.0"
}]
runtime_dependencies
=
[
{
"full_name"
=>
"bar"
,
"version"
=>
"2.0"
},
{
"full_name"
=>
"user/repo/from_tap"
,
"version"
=>
"1.0"
},
]
assert_equal
runtime_dependencies
,
tab
.
runtime_dependencies
assert_equal
runtime_dependencies
,
tab
.
runtime_dependencies
assert_equal
f
.
path
.
to_s
,
tab
.
source
[
"path"
]
assert_equal
f
.
path
.
to_s
,
tab
.
source
[
"path"
]
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/testing_env.rb
+
1
−
1
View file @
28f707c9
...
@@ -124,7 +124,7 @@ module Homebrew
...
@@ -124,7 +124,7 @@ module Homebrew
# Use a stubbed {Formulary::FormulaLoader} to make a given formula be found
# Use a stubbed {Formulary::FormulaLoader} to make a given formula be found
# when loading from {Formulary} with `ref`.
# when loading from {Formulary} with `ref`.
def
stub_formula_loader
(
formula
,
ref
=
formula
.
name
)
def
stub_formula_loader
(
formula
,
ref
=
formula
.
full_
name
)
loader
=
mock
loader
=
mock
loader
.
stubs
(
:get_formula
).
returns
(
formula
)
loader
.
stubs
(
:get_formula
).
returns
(
formula
)
Formulary
.
stubs
(
:loader_for
).
with
(
ref
).
returns
(
loader
)
Formulary
.
stubs
(
:loader_for
).
with
(
ref
).
returns
(
loader
)
...
...
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