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
2122620d
Commit
2122620d
authored
10 years ago
by
Jack Nagel
Browse files
Options
Downloads
Patches
Plain Diff
Fix `brew test` when conflicting minitest gems are installed
parent
ea203c2a
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/cmd/test.rb
+15
-5
15 additions, 5 deletions
Library/Homebrew/cmd/test.rb
Library/Homebrew/formula.rb
+0
-2
0 additions, 2 deletions
Library/Homebrew/formula.rb
with
15 additions
and
7 deletions
Library/Homebrew/cmd/test.rb
+
15
−
5
View file @
2122620d
...
...
@@ -2,16 +2,23 @@ require 'extend/ENV'
require
'hardware'
require
'keg'
require
'timeout'
require
'test/unit/assertions'
module
Homebrew
extend
self
TEST_TIMEOUT_SECONDS
=
5
*
60
if
Object
.
const_defined?
(
:Minitest
)
FailedAssertion
=
Minitest
::
Assertion
elsif
Object
.
const_defined?
(
:MiniTest
)
FailedAssertion
=
MiniTest
::
Assertion
if
defined?
(
Gem
)
begin
gem
"minitest"
,
"< 5.0.0"
rescue
Gem
::
LoadError
require
"test/unit/assertions"
FailedAssertion
=
Test
::
Unit
::
AssertionFailedError
else
require
"minitest/unit"
require
"test/unit/assertions"
FailedAssertion
=
MiniTest
::
Assertion
end
else
require
"test/unit/assertions"
FailedAssertion
=
Test
::
Unit
::
AssertionFailedError
end
...
...
@@ -35,6 +42,9 @@ module Homebrew extend self
end
puts
"Testing
#{
f
.
name
}
"
f
.
extend
(
Test
::
Unit
::
Assertions
)
begin
# tests can also return false to indicate failure
Timeout
::
timeout
TEST_TIMEOUT_SECONDS
do
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/formula.rb
+
0
−
2
View file @
2122620d
...
...
@@ -491,8 +491,6 @@ class Formula
end
def
test
require
'test/unit/assertions'
extend
(
Test
::
Unit
::
Assertions
)
# Adding the used options allows us to use `build.with?` inside of tests
tab
=
Tab
.
for_name
(
name
)
tab
.
used_options
.
each
{
|
opt
|
build
.
args
<<
opt
unless
build
.
has_opposite_of?
opt
}
...
...
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