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
c6784f60
Commit
c6784f60
authored
8 years ago
by
Markus Reiter
Browse files
Options
Downloads
Patches
Plain Diff
Convert formula_spec_selection test to spec.
parent
0dfe85df
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/formula_spec_selection_spec.rb
+100
-0
100 additions, 0 deletions
Library/Homebrew/test/formula_spec_selection_spec.rb
Library/Homebrew/test/formula_spec_selection_test.rb
+0
-99
0 additions, 99 deletions
Library/Homebrew/test/formula_spec_selection_test.rb
with
100 additions
and
99 deletions
Library/Homebrew/test/formula_spec_selection_spec.rb
0 → 100644
+
100
−
0
View file @
c6784f60
require
"formula"
describe
Formula
do
describe
"::new"
do
it
"selects stable by default"
do
f
=
formula
do
url
"foo-1.0"
devel
{
url
"foo-1.1a"
}
head
"foo"
end
expect
(
f
).
to
be_stable
end
it
"selects stable when exclusive"
do
f
=
formula
{
url
"foo-1.0"
}
expect
(
f
).
to
be_stable
end
it
"selects devel before HEAD"
do
f
=
formula
do
devel
{
url
"foo-1.1a"
}
head
"foo"
end
expect
(
f
).
to
be_devel
end
it
"selects devel when exclusive"
do
f
=
formula
{
devel
{
url
"foo-1.1a"
}
}
expect
(
f
).
to
be_devel
end
it
"selects HEAD when exclusive"
do
f
=
formula
{
head
"foo"
}
expect
(
f
).
to
be_head
end
it
"does not select an incomplete spec"
do
f
=
formula
do
sha256
TEST_SHA256
version
"1.0"
head
"foo"
end
expect
(
f
).
to
be_head
end
it
"does not set an incomplete stable spec"
do
f
=
formula
do
sha256
TEST_SHA256
devel
{
url
"foo-1.1a"
}
head
"foo"
end
expect
(
f
.
stable
).
to
be
nil
expect
(
f
).
to
be_devel
end
it
"selects HEAD when requested"
do
f
=
formula
(
"test"
,
spec: :head
)
do
url
"foo-1.0"
devel
{
url
"foo-1.1a"
}
head
"foo"
end
expect
(
f
).
to
be_head
end
it
"selects devel when requested"
do
f
=
formula
(
"test"
,
spec: :devel
)
do
url
"foo-1.0"
devel
{
url
"foo-1.1a"
}
head
"foo"
end
expect
(
f
).
to
be_devel
end
it
"does not set an incomplete devel spec"
do
f
=
formula
do
url
"foo-1.0"
devel
{
version
"1.1a"
}
head
"foo"
end
expect
(
f
.
devel
).
to
be
nil
expect
(
f
).
to
be_stable
end
it
"does not raise an error for a missing spec"
do
f
=
formula
(
"test"
,
spec: :devel
)
do
url
"foo-1.0"
head
"foo"
end
expect
(
f
).
to
be_stable
end
end
end
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/formula_spec_selection_test.rb
deleted
100644 → 0
+
0
−
99
View file @
0dfe85df
require
"testing_env"
require
"formula"
class
FormulaSpecSelectionTests
<
Homebrew
::
TestCase
def
test_selects_stable_by_default
f
=
formula
do
url
"foo-1.0"
devel
{
url
"foo-1.1a"
}
head
"foo"
end
assert_predicate
f
,
:stable?
end
def
test_selects_stable_when_exclusive
f
=
formula
{
url
"foo-1.0"
}
assert_predicate
f
,
:stable?
end
def
test_selects_devel_before_head
f
=
formula
do
devel
{
url
"foo-1.1a"
}
head
"foo"
end
assert_predicate
f
,
:devel?
end
def
test_selects_devel_when_exclusive
f
=
formula
{
devel
{
url
"foo-1.1a"
}
}
assert_predicate
f
,
:devel?
end
def
test_selects_head_when_exclusive
f
=
formula
{
head
"foo"
}
assert_predicate
f
,
:head?
end
def
test_incomplete_spec_not_selected
f
=
formula
do
sha256
TEST_SHA256
version
"1.0"
head
"foo"
end
assert_predicate
f
,
:head?
end
def
test_incomplete_stable_not_set
f
=
formula
do
sha256
TEST_SHA256
devel
{
url
"foo-1.1a"
}
head
"foo"
end
assert_nil
f
.
stable
assert_predicate
f
,
:devel?
end
def
test_selects_head_when_requested
f
=
formula
(
"test"
,
Pathname
.
new
(
__FILE__
).
expand_path
,
:head
)
do
url
"foo-1.0"
devel
{
url
"foo-1.1a"
}
head
"foo"
end
assert_predicate
f
,
:head?
end
def
test_selects_devel_when_requested
f
=
formula
(
"test"
,
Pathname
.
new
(
__FILE__
).
expand_path
,
:devel
)
do
url
"foo-1.0"
devel
{
url
"foo-1.1a"
}
head
"foo"
end
assert_predicate
f
,
:devel?
end
def
test_incomplete_devel_not_set
f
=
formula
do
url
"foo-1.0"
devel
{
version
"1.1a"
}
head
"foo"
end
assert_nil
f
.
devel
assert_predicate
f
,
:stable?
end
def
test_does_not_raise_for_missing_spec
f
=
formula
(
"test"
,
Pathname
.
new
(
__FILE__
).
expand_path
,
:devel
)
do
url
"foo-1.0"
head
"foo"
end
assert_predicate
f
,
:stable?
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