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
1c4203fe
Commit
1c4203fe
authored
8 years ago
by
Markus Reiter
Browse files
Options
Downloads
Patches
Plain Diff
Convert `brew search` test to spec.
parent
c7121f6b
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/cmd/search_spec.rb
+57
-0
57 additions, 0 deletions
Library/Homebrew/test/cmd/search_spec.rb
Library/Homebrew/test/search_test.rb
+0
-30
0 additions, 30 deletions
Library/Homebrew/test/search_test.rb
with
57 additions
and
30 deletions
Library/Homebrew/test/cmd/search_spec.rb
0 → 100644
+
57
−
0
View file @
1c4203fe
describe
"brew search"
,
:integration_test
do
before
(
:each
)
do
setup_test_formula
"testball"
end
it
"lists all available Formulae when no argument is given"
do
expect
{
brew
"search"
}
.
to
output
(
/testball/
).
to_stdout
.
and
not_to_output
.
to_stderr
.
and
be_a_success
end
it
"supports searching by name"
do
expect
{
brew
"search"
,
"testball"
}
.
to
output
(
/testball/
).
to_stdout
.
and
not_to_output
.
to_stderr
.
and
be_a_success
end
it
"supports searching a fully-qualified name "
do
expect
{
brew
"search"
,
"homebrew/homebrew-core/testball"
}
.
to
output
(
/testball/
).
to_stdout
.
and
not_to_output
.
to_stderr
.
and
be_a_success
end
describe
"--desc"
do
let
(
:desc_cache
)
{
HOMEBREW_CACHE
/
"desc_cache.json"
}
it
"supports searching in descriptions and creates a description cache"
do
expect
(
desc_cache
).
not_to
exist
expect
{
brew
"search"
,
"--desc"
,
"Some test"
}
.
to
output
(
/testball/
).
to_stdout
.
and
not_to_output
.
to_stderr
.
and
be_a_success
expect
(
desc_cache
).
to
exist
end
end
{
"macports"
=>
"https://www.macports.org/ports.php?by=name&substr=testball"
,
"fink"
=>
"http://pdb.finkproject.org/pdb/browse.php?summary=testball"
,
"debian"
=>
"https://packages.debian.org/search?keywords=testball&searchon=names&suite=all§ion=all"
,
"opensuse"
=>
"https://software.opensuse.org/search?q=testball"
,
"fedora"
=>
"https://admin.fedoraproject.org/pkgdb/packages/%2Atestball%2A/"
,
"ubuntu"
=>
"http://packages.ubuntu.com/search?keywords=testball&searchon=names&suite=all§ion=all"
,
}.
each
do
|
flag
,
url
|
specify
"--
#{
flag
}
"
do
expect
{
brew
"search"
,
"--
#{
flag
}
"
,
"testball"
,
"HOMEBREW_BROWSER"
=>
"echo"
}
.
to
output
(
"
#{
url
}
\n
"
).
to_stdout
.
and
not_to_output
.
to_stderr
.
and
be_a_success
end
end
end
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/search_test.rb
deleted
100644 → 0
+
0
−
30
View file @
c7121f6b
require
"testing_env"
class
IntegrationCommandTestSearch
<
IntegrationCommandTestCase
def
test_search
setup_test_formula
"testball"
desc_cache
=
HOMEBREW_CACHE
/
"desc_cache.json"
refute_predicate
desc_cache
,
:exist?
,
"Cached file should not exist"
assert_match
"testball"
,
cmd
(
"search"
)
assert_match
"testball"
,
cmd
(
"search"
,
"testball"
)
assert_match
"testball"
,
cmd
(
"search"
,
"homebrew/homebrew-core/testball"
)
assert_match
"testball"
,
cmd
(
"search"
,
"--desc"
,
"Some test"
)
flags
=
{
"macports"
=>
"https://www.macports.org/ports.php?by=name&substr=testball"
,
"fink"
=>
"http://pdb.finkproject.org/pdb/browse.php?summary=testball"
,
"debian"
=>
"https://packages.debian.org/search?keywords=testball&searchon=names&suite=all§ion=all"
,
"opensuse"
=>
"https://software.opensuse.org/search?q=testball"
,
"fedora"
=>
"https://admin.fedoraproject.org/pkgdb/packages/%2Atestball%2A/"
,
"ubuntu"
=>
"http://packages.ubuntu.com/search?keywords=testball&searchon=names&suite=all§ion=all"
,
}
flags
.
each
do
|
flag
,
url
|
assert_equal
url
,
cmd
(
"search"
,
"--
#{
flag
}
"
,
"testball"
,
"HOMEBREW_BROWSER"
=>
"echo"
)
end
assert_predicate
desc_cache
,
:exist?
,
"Cached file should exist"
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