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
e637eb41
Commit
e637eb41
authored
8 years ago
by
Markus Reiter
Browse files
Options
Downloads
Patches
Plain Diff
Convert Fetch test to spec.
parent
3ef51dba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Library/Homebrew/cask/spec/cask/cli/fetch_spec.rb
+11
-12
11 additions, 12 deletions
Library/Homebrew/cask/spec/cask/cli/fetch_spec.rb
with
11 additions
and
12 deletions
Library/Homebrew/cask/
test
/cask/cli/fetch_
test
.rb
→
Library/Homebrew/cask/
spec
/cask/cli/fetch_
spec
.rb
+
11
−
12
View file @
e637eb41
require
"
test
_helper"
require
"
spec
_helper"
describe
Hbc
::
CLI
::
Fetch
do
let
(
:local_transmission
)
{
...
...
@@ -13,8 +13,8 @@ describe Hbc::CLI::Fetch do
shutup
do
Hbc
::
CLI
::
Fetch
.
run
(
"local-transmission"
,
"local-caffeine"
)
end
Hbc
::
CurlDownloadStrategy
.
new
(
local_transmission
).
cached_location
.
must_be
:
exist
?
Hbc
::
CurlDownloadStrategy
.
new
(
local_caffeine
).
cached_location
.
must_be
:
exist
?
expect
(
Hbc
::
CurlDownloadStrategy
.
new
(
local_transmission
).
cached_location
).
to
exist
expect
(
Hbc
::
CurlDownloadStrategy
.
new
(
local_caffeine
).
cached_location
).
to
exist
end
it
"prevents double fetch (without nuking existing installation)"
do
...
...
@@ -30,7 +30,7 @@ describe Hbc::CLI::Fetch do
end
new_ctime
=
File
.
stat
(
download_stategy
.
cached_location
).
ctime
old_ctime
.
to_i
.
must_equal
new_ctime
.
to_i
expect
(
old_ctime
.
to_i
).
to
eq
(
new_ctime
.
to_i
)
end
it
"allows double fetch with --force"
do
...
...
@@ -48,31 +48,30 @@ describe Hbc::CLI::Fetch do
download_stategy
=
Hbc
::
CurlDownloadStrategy
.
new
(
local_transmission
)
new_ctime
=
File
.
stat
(
download_stategy
.
cached_location
).
ctime
# new_ctime.to_i.must_be :>, old_ctime.to_i
new_ctime
.
to_i
.
must_be
:
>
,
old_ctime
.
to_i
expect
(
new_ctime
.
to_i
).
to
be
>
old_ctime
.
to_i
end
it
"properly handles Casks that are not present"
do
lambda
{
expect
{
shutup
do
Hbc
::
CLI
::
Fetch
.
run
(
"notacask"
)
end
}.
must_raise
Hbc
::
CaskUnavailableError
}.
to
raise_error
(
Hbc
::
CaskUnavailableError
)
end
describe
"when no Cask is specified"
do
it
"raises an exception"
do
lambda
{
expect
{
Hbc
::
CLI
::
Fetch
.
run
}.
must_raise
Hbc
::
CaskUnspecifiedError
}.
to
raise_error
(
Hbc
::
CaskUnspecifiedError
)
end
end
describe
"when no Cask is specified, but an invalid option"
do
it
"raises an exception"
do
lambda
{
expect
{
Hbc
::
CLI
::
Fetch
.
run
(
"--notavalidoption"
)
}.
must_raise
Hbc
::
CaskUnspecifiedError
}.
to
raise_error
(
Hbc
::
CaskUnspecifiedError
)
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