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
d9b2fdbe
Commit
d9b2fdbe
authored
8 years ago
by
Markus Reiter
Browse files
Options
Downloads
Patches
Plain Diff
Convert `brew log` 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/log_spec.rb
+41
-0
41 additions, 0 deletions
Library/Homebrew/test/cmd/log_spec.rb
Library/Homebrew/test/log_test.rb
+0
-13
0 additions, 13 deletions
Library/Homebrew/test/log_test.rb
with
41 additions
and
13 deletions
Library/Homebrew/test/
log_formula_test
.rb
→
Library/Homebrew/test/
cmd/log_spec
.rb
+
41
−
0
View file @
d9b2fdbe
require
"testing_env"
describe
"brew log"
,
:integration_test
do
it
"shows the Git log for the Homebrew repository when no argument is given"
do
HOMEBREW_REPOSITORY
.
cd
do
shutup
do
system
"git"
,
"init"
system
"git"
,
"commit"
,
"--allow-empty"
,
"-m"
,
"This is a test commit"
end
end
class
IntegrationCommandTestLogFormula
<
IntegrationCommandTestCase
def
test_log_formula
core_tap
=
CoreTap
.
new
expect
{
brew
"log"
}
.
to
output
(
/This is a test commit/
).
to_stdout
.
and
not_to_output
.
to_stderr
.
and
be_a_success
end
it
"shows the Git log for a given Formula"
do
setup_test_formula
"testball"
core_tap
=
CoreTap
.
new
core_tap
.
path
.
cd
do
shutup
do
system
"git"
,
"init"
...
...
@@ -19,9 +31,11 @@ class IntegrationCommandTestLogFormula < IntegrationCommandTestCase
system
"git"
,
"clone"
,
"--depth=1"
,
core_tap_url
,
shallow_tap
.
path
end
assert_match
"This is a test commit for Testball"
,
cmd
(
"log"
,
"
#{
shallow_tap
}
/testball"
)
assert_predicate
shallow_tap
.
path
/
".git/shallow"
,
:exist?
,
"A shallow clone should have been created."
expect
{
brew
"log"
,
"
#{
shallow_tap
}
/testball"
}
.
to
output
(
/This is a test commit for Testball/
).
to_stdout
.
and
output
(
/Warning: The git repository is a shallow clone/
).
to_stderr
.
and
be_a_success
expect
(
shallow_tap
.
path
/
".git/shallow"
).
to
exist
,
"A shallow clone should have been created."
end
end
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/log_test.rb
deleted
100644 → 0
+
0
−
13
View file @
c7121f6b
require
"testing_env"
class
IntegrationCommandTestLog
<
IntegrationCommandTestCase
def
test_log
FileUtils
.
cd
HOMEBREW_REPOSITORY
do
shutup
do
system
"git"
,
"init"
system
"git"
,
"commit"
,
"--allow-empty"
,
"-m"
,
"This is a test commit"
end
end
assert_match
"This is a test commit"
,
cmd
(
"log"
)
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