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
9c914106
Unverified
Commit
9c914106
authored
4 years ago
by
nandahkrishna
Browse files
Options
Downloads
Patches
Plain Diff
dev-cmd/bump: increase test coverage
parent
95c6e92d
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/dev-cmd/bump.rb
+13
-21
13 additions, 21 deletions
Library/Homebrew/dev-cmd/bump.rb
Library/Homebrew/test/dev-cmd/bump_spec.rb
+14
-0
14 additions, 0 deletions
Library/Homebrew/test/dev-cmd/bump_spec.rb
with
27 additions
and
21 deletions
Library/Homebrew/dev-cmd/bump.rb
+
13
−
21
View file @
9c914106
...
...
@@ -41,18 +41,8 @@ module Homebrew
next
end
current_version
=
formula
.
stable
.
version
.
to_s
package_data
=
Repology
.
single_package_query
(
formula
.
name
)
repology_latest
=
if
package_data
.
present?
Repology
.
latest_version
(
package_data
.
values
.
first
)
else
"not found"
end
livecheck_latest
=
livecheck_result
(
formula
)
pull_requests
=
retrieve_pull_requests
(
formula
)
display
(
formula
,
current_version
,
repology_latest
,
livecheck_latest
,
pull_requests
)
retrieve_and_display_info
(
formula
,
package_data
&
.
values
&
.
first
)
end
else
outdated_packages
=
Repology
.
parse_api_response
(
requested_limit
)
...
...
@@ -71,11 +61,7 @@ module Homebrew
next
end
current_version
=
formula
.
stable
.
version
.
to_s
repology_latest
=
Repology
.
latest_version
(
repositories
)
livecheck_latest
=
livecheck_result
(
formula
)
pull_requests
=
retrieve_pull_requests
(
formula
)
display
(
formula
,
current_version
,
repology_latest
,
livecheck_latest
,
pull_requests
)
retrieve_and_display_info
(
formula
,
repositories
)
break
if
requested_limit
&&
i
>=
requested_limit
end
...
...
@@ -110,12 +96,18 @@ module Homebrew
pull_requests
end
def
up_to_date?
(
current_version
,
repology_latest
,
livecheck_latest
)
current_version
==
repology_latest
&&
current_version
==
livecheck_latest
end
def
retrieve_and_display_info
(
formula
,
repositories
)
current_version
=
formula
.
stable
.
version
.
to_s
repology_latest
=
if
repositories
.
present?
Repology
.
latest_version
(
repositories
)
else
"not found"
end
livecheck_latest
=
livecheck_result
(
formula
)
pull_requests
=
retrieve_pull_requests
(
formula
)
def
display
(
formula
,
current_version
,
repology_latest
,
livecheck_latest
,
pull_requests
)
title
=
if
current_version
==
repology_latest
&&
current_version
==
livecheck_latest
"
#{
formula
}
is up to date!"
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/dev-cmd/bump_spec.rb
+
14
−
0
View file @
9c914106
...
...
@@ -27,5 +27,19 @@ describe "brew bump" do
.
and
not_to_output
.
to_stderr
.
and
be_a_success
end
it
"returns no data and prints a message for HEAD-only formulae"
do
content
=
<<~
RUBY
desc "HEAD-only test formula"
homepage "https://brew.sh"
head "https://github.com/Homebrew/brew.git"
RUBY
setup_test_formula
(
"headonly"
,
content
)
expect
{
brew
"bump"
,
"headonly"
}
.
to
output
(
/Formula is HEAD-only./
).
to_stdout
.
and
not_to_output
.
to_stderr
.
and
be_a_success
end
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