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
fab877de
Commit
fab877de
authored
15 years ago
by
Eloy Duran
Committed by
Max Howell
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Made the tests green for the updater component
parent
5a2eae5d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Library/Homebrew/unittest.rb
+18
-2
18 additions, 2 deletions
Library/Homebrew/unittest.rb
with
18 additions
and
2 deletions
Library/Homebrew/unittest.rb
+
18
−
2
View file @
fab877de
...
...
@@ -34,18 +34,21 @@ require 'ARGV+yeast' # needs to be after test/unit to avoid conflict with Option
class
MockFormula
<
Formula
def
initialize
url
@url
=
url
@homepage
=
'http://example.com/'
super
'test'
end
end
class
MostlyAbstractFormula
<
Formula
@url
=
''
@homepage
=
'http://example.com/'
end
class
TestBall
<
Formula
# name parameter required for some Formula::factory
def
initialize
name
=
nil
@url
=
"file:///
#{
Pathname
.
new
(
ABS__FILE__
).
parent
.
realpath
}
/testball-0.1.tbz"
@homepage
=
'http://example.com/'
super
"testball"
end
def
install
...
...
@@ -59,6 +62,7 @@ class TestZip <Formula
zip
=
HOMEBREW_CACHE
.
parent
+
'test-0.1.zip'
Kernel
.
system
'/usr/bin/zip'
,
'-0'
,
zip
,
ABS__FILE__
@url
=
"file://
#{
zip
}
"
@homepage
=
'http://example.com/'
super
'testzip'
end
end
...
...
@@ -80,8 +84,9 @@ class TestScriptFileFormula <ScriptFileFormula
version
"1"
def
initialize
super
@name
=
'test-script-formula'
@homepage
=
'http://example.com/'
super
end
end
...
...
@@ -357,7 +362,18 @@ class BeerTasting <Test::Unit::TestCase
path
=
HOMEBREW_PREFIX
+
'Library'
+
'Formula'
+
"
#{
FOOBAR
}
.rb"
path
.
dirname
.
mkpath
`echo "require 'brewkit'; class
#{
classname
}
<Formula; @url=''; end" >
#{
path
}
`
File
.
open
(
path
,
'w'
)
do
|
f
|
f
<<
%{
require 'brewkit'
class
#{
classname
}
< Formula
@url=''
def initialize(*args)
@homepage = 'http://example.com/'
super
end
end
}
end
assert_not_nil
Formula
.
factory
(
FOOBAR
)
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