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
0b2c6e87
Commit
0b2c6e87
authored
11 years ago
by
Jack Nagel
Browse files
Options
Downloads
Patches
Plain Diff
Implement equality for Dependencies collections
parent
257a2206
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/dependencies.rb
+8
-0
8 additions, 0 deletions
Library/Homebrew/dependencies.rb
Library/Homebrew/test/test_dependencies.rb
+18
-0
18 additions, 0 deletions
Library/Homebrew/test/test_dependencies.rb
with
26 additions
and
0 deletions
Library/Homebrew/dependencies.rb
+
8
−
0
View file @
0b2c6e87
...
...
@@ -46,4 +46,12 @@ class Dependencies
def
default
build
+
required
+
recommended
end
attr_reader
:deps
protected
:deps
def
==
(
other
)
deps
==
other
.
deps
end
alias_method
:eql?
,
:==
end
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/test_dependencies.rb
+
18
−
0
View file @
0b2c6e87
...
...
@@ -59,4 +59,22 @@ class DependenciesTests < Test::Unit::TestCase
assert_equal
[
qux
],
@deps
.
recommended
assert_equal
[
foo
,
baz
,
quux
,
qux
].
sort_by
(
&
:name
),
@deps
.
default
.
sort_by
(
&
:name
)
end
def
test_equality
a
=
Dependencies
.
new
b
=
Dependencies
.
new
dep
=
Dependency
.
new
(
"foo"
)
a
<<
dep
b
<<
dep
assert_equal
a
,
b
assert
a
.
eql?
(
b
)
b
<<
Dependency
.
new
(
"bar"
,
[
:optional
])
assert_not_equal
a
,
b
assert
!
a
.
eql?
(
b
)
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