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
6392f5f0
Commit
6392f5f0
authored
8 years ago
by
Markus Reiter
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #2219 from reitermarkus/spec-formula_support
Convert `formula_support` test to spec.
parents
a21727f5
fb09867b
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_support_spec.rb
+29
-0
29 additions, 0 deletions
Library/Homebrew/test/formula_support_spec.rb
Library/Homebrew/test/formula_support_test.rb
+0
-28
0 additions, 28 deletions
Library/Homebrew/test/formula_support_test.rb
with
29 additions
and
28 deletions
Library/Homebrew/test/formula_support_spec.rb
0 → 100644
+
29
−
0
View file @
6392f5f0
require
"formula_support"
describe
KegOnlyReason
do
describe
"#to_s"
do
it
"returns the reason provided"
do
r
=
KegOnlyReason
.
new
:provided_by_osx
,
"test"
expect
(
r
.
to_s
).
to
eq
(
"test"
)
end
it
"returns a default message when no reason is provided"
do
r
=
KegOnlyReason
.
new
:provided_by_macos
,
""
expect
(
r
.
to_s
).
to
match
(
/^macOS already provides/
)
end
end
end
describe
BottleDisableReason
do
specify
":unneeded"
do
bottle_disable_reason
=
BottleDisableReason
.
new
:unneeded
,
nil
expect
(
bottle_disable_reason
).
to
be_unneeded
expect
(
bottle_disable_reason
.
to_s
).
to
eq
(
"This formula doesn't require compiling."
)
end
specify
":disabled"
do
bottle_disable_reason
=
BottleDisableReason
.
new
:disable
,
"reason"
expect
(
bottle_disable_reason
).
not_to
be_unneeded
expect
(
bottle_disable_reason
.
to_s
).
to
eq
(
"reason"
)
end
end
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/formula_support_test.rb
deleted
100644 → 0
+
0
−
28
View file @
a21727f5
require
"testing_env"
require
"formula_support"
class
KegOnlyReasonTests
<
Homebrew
::
TestCase
def
test_to_s_explanation
r
=
KegOnlyReason
.
new
:provided_by_osx
,
"test"
assert_equal
"test"
,
r
.
to_s
end
def
test_to_s_no_explanation
r
=
KegOnlyReason
.
new
:provided_by_macos
,
""
assert_match
(
/^macOS already provides/
,
r
.
to_s
)
end
end
class
BottleDisableReasonTests
<
Homebrew
::
TestCase
def
test_bottle_unneeded
bottle_disable_reason
=
BottleDisableReason
.
new
:unneeded
,
nil
assert_predicate
bottle_disable_reason
,
:unneeded?
assert_equal
"This formula doesn't require compiling."
,
bottle_disable_reason
.
to_s
end
def
test_bottle_disabled
bottle_disable_reason
=
BottleDisableReason
.
new
:disable
,
"reason"
refute_predicate
bottle_disable_reason
,
:unneeded?
assert_equal
"reason"
,
bottle_disable_reason
.
to_s
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