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
89a4a7a7
Commit
89a4a7a7
authored
8 years ago
by
Markus Reiter
Browse files
Options
Downloads
Patches
Plain Diff
Convert `os/mac/dependency_collector` test to spec.
parent
9a0116d5
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/os/mac/dependency_collector_spec.rb
+50
-0
50 additions, 0 deletions
Library/Homebrew/test/os/mac/dependency_collector_spec.rb
Library/Homebrew/test/os/mac/dependency_collector_test.rb
+0
-59
0 additions, 59 deletions
Library/Homebrew/test/os/mac/dependency_collector_test.rb
with
50 additions
and
59 deletions
Library/Homebrew/test/os/mac/dependency_collector_spec.rb
0 → 100644
+
50
−
0
View file @
89a4a7a7
require
"dependency_collector"
RSpec
::
Matchers
.
alias_matcher
:need_tar_xz_dependency
,
:be_tar_needs_xz_dependency
describe
DependencyCollector
do
after
(
:each
)
do
described_class
.
clear_cache
end
specify
"#tar_needs_xz_dependency?"
do
allow
(
MacOS
).
to
receive
(
:version
).
and_return
(
MacOS
::
Version
.
new
(
"10.9"
))
expect
(
described_class
).
not_to
need_tar_xz_dependency
end
specify
"LD64 pre-Leopard dependency"
do
allow
(
MacOS
).
to
receive
(
:version
).
and_return
(
MacOS
::
Version
.
new
(
"10.4"
))
expect
(
subject
.
build
(
:ld64
)).
to
eq
(
LD64Dependency
.
new
)
end
specify
"LD64 Leopard or newer dependency"
do
allow
(
MacOS
).
to
receive
(
:version
).
and_return
(
MacOS
::
Version
.
new
(
"10.5"
))
expect
(
subject
.
build
(
:ld64
)).
to
be
nil
end
specify
"ant Mavericks or newer dependency"
do
allow
(
MacOS
).
to
receive
(
:version
).
and_return
(
MacOS
::
Version
.
new
(
"10.9"
))
subject
.
add
ant: :build
expect
(
subject
.
deps
.
find
{
|
dep
|
dep
.
name
==
"ant"
}).
to
eq
(
Dependency
.
new
(
"ant"
,
[
:build
]))
end
specify
"ant pre-Mavericks dependency"
do
allow
(
MacOS
).
to
receive
(
:version
).
and_return
(
MacOS
::
Version
.
new
(
"10.7"
))
subject
.
add
ant: :build
expect
(
subject
.
deps
.
find
{
|
dep
|
dep
.
name
==
"ant"
}).
to
be
nil
end
specify
"Resource xz pre-Mavericks dependency"
do
allow
(
MacOS
).
to
receive
(
:version
).
and_return
(
MacOS
::
Version
.
new
(
"10.8"
))
resource
=
Resource
.
new
resource
.
url
(
"http://example.com/foo.tar.xz"
)
expect
(
subject
.
add
(
resource
)).
to
eq
(
Dependency
.
new
(
"xz"
,
[
:build
]))
end
specify
"Resource xz Mavericks or newer dependency"
do
allow
(
MacOS
).
to
receive
(
:version
).
and_return
(
MacOS
::
Version
.
new
(
"10.9"
))
resource
=
Resource
.
new
resource
.
url
(
"http://example.com/foo.tar.xz"
)
expect
(
subject
.
add
(
resource
)).
to
be
nil
end
end
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/os/mac/dependency_collector_test.rb
deleted
100644 → 0
+
0
−
59
View file @
9a0116d5
require
"testing_env"
require
"dependency_collector"
class
OSMacDependencyCollectorTests
<
Homebrew
::
TestCase
def
find_dependency
(
name
)
@d
.
deps
.
find
{
|
dep
|
dep
.
name
==
name
}
end
def
setup
super
@d
=
DependencyCollector
.
new
end
def
teardown
DependencyCollector
.
clear_cache
super
end
def
test_tar_needs_xz_dependency
MacOS
.
stubs
(
:version
).
returns
(
MacOS
::
Version
.
new
(
"10.9"
))
refute
DependencyCollector
.
tar_needs_xz_dependency?
end
def
test_ld64_dep_pre_leopard
MacOS
.
stubs
(
:version
).
returns
(
MacOS
::
Version
.
new
(
"10.4"
))
assert_equal
LD64Dependency
.
new
,
@d
.
build
(
:ld64
)
end
def
test_ld64_dep_leopard_or_newer
MacOS
.
stubs
(
:version
).
returns
(
MacOS
::
Version
.
new
(
"10.5"
))
assert_nil
@d
.
build
(
:ld64
)
end
def
test_ant_dep_mavericks_or_newer
MacOS
.
stubs
(
:version
).
returns
(
MacOS
::
Version
.
new
(
"10.9"
))
@d
.
add
ant: :build
assert_equal
find_dependency
(
"ant"
),
Dependency
.
new
(
"ant"
,
[
:build
])
end
def
test_ant_dep_pre_mavericks
MacOS
.
stubs
(
:version
).
returns
(
MacOS
::
Version
.
new
(
"10.7"
))
@d
.
add
ant: :build
assert_nil
find_dependency
(
"ant"
)
end
def
test_resource_dep_xz_pre_mavericks
MacOS
.
stubs
(
:version
).
returns
(
MacOS
::
Version
.
new
(
"10.8"
))
resource
=
Resource
.
new
resource
.
url
(
"http://example.com/foo.tar.xz"
)
assert_equal
Dependency
.
new
(
"xz"
,
[
:build
]),
@d
.
add
(
resource
)
end
def
test_resource_dep_xz_mavericks_or_newer
MacOS
.
stubs
(
:version
).
returns
(
MacOS
::
Version
.
new
(
"10.9"
))
resource
=
Resource
.
new
resource
.
url
(
"http://example.com/foo.tar.xz"
)
assert_nil
@d
.
add
(
resource
)
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