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
3ada4079
Commit
3ada4079
authored
13 years ago
by
Charlie Sharpsteen
Browse files
Options
Downloads
Patches
Plain Diff
mirror support: Add test
parent
9d19506e
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_formula.rb
+12
-1
12 additions, 1 deletion
Library/Homebrew/test/test_formula.rb
Library/Homebrew/test/testball.rb
+12
-0
12 additions, 0 deletions
Library/Homebrew/test/testball.rb
with
24 additions
and
1 deletion
Library/Homebrew/test/test_formula.rb
+
12
−
1
View file @
3ada4079
...
...
@@ -6,6 +6,9 @@ ARGV.extend(HomebrewArgvExtension)
require
'test/testball'
require
'utils'
class
AbstractDownloadStrategy
attr_reader
:url
end
class
MostlyAbstractFormula
<
Formula
@url
=
''
...
...
@@ -50,5 +53,13 @@ class FormulaTests < Test::Unit::TestCase
assert_raises
(
RuntimeError
)
{
f
.
prefix
}
nostdout
{
assert_raises
(
RuntimeError
)
{
f
.
brew
}
}
end
def
test_mirror_support
HOMEBREW_CACHE
.
mkpath
unless
HOMEBREW_CACHE
.
exist?
f
=
TestBallWithMirror
.
new
tarball
,
downloader
=
f
.
fetch
assert_equal
f
.
url
,
"file:///
#{
TEST_FOLDER
}
/bad_url/testball-0.1.tbz"
assert_equal
downloader
.
url
,
"file:///
#{
TEST_FOLDER
}
/tarballs/testball-0.1.tbz"
end
end
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/testball.rb
+
12
−
0
View file @
3ada4079
...
...
@@ -13,6 +13,18 @@ class TestBall <Formula
end
end
class
TestBallWithMirror
<
Formula
# `url` is bogus---curl should fail to download it. The mirror is fine
# though.
url
"file:///
#{
TEST_FOLDER
}
/bad_url/testball-0.1.tbz"
mirror
"file:///
#{
TEST_FOLDER
}
/tarballs/testball-0.1.tbz"
def
initialize
name
=
nil
@homepage
=
'http://example.com/'
super
"testballwithmirror"
end
end
class
ConfigureFails
<
Formula
# name parameter required for some Formula::factory
def
initialize
name
=
nil
...
...
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