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
4de74bf7
Commit
4de74bf7
authored
8 years ago
by
Markus Reiter
Browse files
Options
Downloads
Patches
Plain Diff
Convert uninstall test to spec.
parent
2cecf980
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/artifact/uninstall_spec.rb
+17
-17
17 additions, 17 deletions
Library/Homebrew/cask/spec/cask/artifact/uninstall_spec.rb
with
17 additions
and
17 deletions
Library/Homebrew/cask/
test
/cask/artifact/uninstall_
test
.rb
→
Library/Homebrew/cask/
spec
/cask/artifact/uninstall_
spec
.rb
+
17
−
17
View file @
4de74bf7
require
"
test
_helper"
require
"
spec
_helper"
describe
Hbc
::
Artifact
::
Uninstall
do
let
(
:cask
)
{
Hbc
::
CaskLoader
.
load_from_file
(
TEST_FIXTURE_DIR
/
"cask/Casks/with-installable.rb"
)
}
...
...
@@ -7,9 +7,9 @@ describe Hbc::Artifact::Uninstall do
Hbc
::
Artifact
::
Uninstall
.
new
(
cask
,
command:
Hbc
::
FakeSystemCommand
)
}
before
do
before
(
:each
)
do
shutup
do
Test
Helper
.
install_without_artifacts
(
cask
)
Install
Helper
.
install_without_artifacts
(
cask
)
end
end
...
...
@@ -20,7 +20,7 @@ describe Hbc::Artifact::Uninstall do
end
}
describe
"when using launchctl"
do
context
"when using launchctl"
do
let
(
:cask
)
{
Hbc
::
CaskLoader
.
load_from_file
(
TEST_FIXTURE_DIR
/
"cask/Casks/with-uninstall-launchctl.rb"
)
}
let
(
:launchctl_list_cmd
)
{
%w[/bin/launchctl list my.fancy.package.service]
}
let
(
:launchctl_remove_cmd
)
{
%w[/bin/launchctl remove my.fancy.package.service]
}
...
...
@@ -40,7 +40,7 @@ describe Hbc::Artifact::Uninstall do
EOS
}
describe
"when launchctl job is owned by user"
do
context
"when launchctl job is owned by user"
do
it
"can uninstall"
do
Hbc
::
FakeSystemCommand
.
stubs_command
(
launchctl_list_cmd
,
...
...
@@ -58,7 +58,7 @@ describe Hbc::Artifact::Uninstall do
end
end
describe
"when launchctl job is owned by system"
do
context
"when launchctl job is owned by system"
do
it
"can uninstall"
do
Hbc
::
FakeSystemCommand
.
stubs_command
(
launchctl_list_cmd
,
...
...
@@ -77,7 +77,7 @@ describe Hbc::Artifact::Uninstall do
end
end
describe
"when using pkgutil"
do
context
"when using pkgutil"
do
let
(
:cask
)
{
Hbc
::
CaskLoader
.
load_from_file
(
TEST_FIXTURE_DIR
/
"cask/Casks/with-uninstall-pkgutil.rb"
)
}
let
(
:main_pkg_id
)
{
"my.fancy.package.main"
}
let
(
:agent_pkg_id
)
{
"my.fancy.package.agent"
}
...
...
@@ -163,7 +163,7 @@ describe Hbc::Artifact::Uninstall do
end
end
describe
"when using kext"
do
context
"when using kext"
do
let
(
:cask
)
{
Hbc
::
CaskLoader
.
load_from_file
(
TEST_FIXTURE_DIR
/
"cask/Casks/with-uninstall-kext.rb"
)
}
let
(
:kext_id
)
{
"my.fancy.package.kernelextension"
}
...
...
@@ -188,7 +188,7 @@ describe Hbc::Artifact::Uninstall do
end
end
describe
"when using quit"
do
context
"when using quit"
do
let
(
:cask
)
{
Hbc
::
CaskLoader
.
load_from_file
(
TEST_FIXTURE_DIR
/
"cask/Casks/with-uninstall-quit.rb"
)
}
let
(
:bundle_id
)
{
"my.fancy.package.app"
}
let
(
:quit_application_script
)
{
...
...
@@ -208,7 +208,7 @@ describe Hbc::Artifact::Uninstall do
end
end
describe
"when using signal"
do
context
"when using signal"
do
let
(
:cask
)
{
Hbc
::
CaskLoader
.
load_from_file
(
TEST_FIXTURE_DIR
/
"cask/Casks/with-uninstall-signal.rb"
)
}
let
(
:bundle_id
)
{
"my.fancy.package.app"
}
let
(
:signals
)
{
%w[TERM KILL]
}
...
...
@@ -220,14 +220,14 @@ describe Hbc::Artifact::Uninstall do
)
signals
.
each
do
|
signal
|
Process
.
expects
(
:kill
).
with
(
signal
,
*
unix_pids
)
expect
(
Process
).
to
receive
(
:kill
).
with
(
signal
,
*
unix_pids
)
end
subject
end
end
describe
"when using delete"
do
context
"when using delete"
do
let
(
:cask
)
{
Hbc
::
CaskLoader
.
load_from_file
(
TEST_FIXTURE_DIR
/
"cask/Casks/with-uninstall-delete.rb"
)
}
it
"can uninstall"
do
...
...
@@ -241,7 +241,7 @@ describe Hbc::Artifact::Uninstall do
end
end
describe
"when using trash"
do
context
"when using trash"
do
let
(
:cask
)
{
Hbc
::
CaskLoader
.
load_from_file
(
TEST_FIXTURE_DIR
/
"cask/Casks/with-uninstall-trash.rb"
)
}
it
"can uninstall"
do
...
...
@@ -255,7 +255,7 @@ describe Hbc::Artifact::Uninstall do
end
end
describe
"when using rmdir"
do
context
"when using rmdir"
do
let
(
:cask
)
{
Hbc
::
CaskLoader
.
load_from_file
(
TEST_FIXTURE_DIR
/
"cask/Casks/with-uninstall-rmdir.rb"
)
}
let
(
:dir_pathname
)
{
Pathname
.
new
(
"
#{
TEST_FIXTURE_DIR
}
/cask/empty_directory"
)
}
...
...
@@ -272,7 +272,7 @@ describe Hbc::Artifact::Uninstall do
end
end
describe
"when using script"
do
context
"when using script"
do
let
(
:cask
)
{
Hbc
::
CaskLoader
.
load_from_file
(
TEST_FIXTURE_DIR
/
"cask/Casks/with-uninstall-script.rb"
)
}
let
(
:script_pathname
)
{
cask
.
staged_path
.
join
(
"MyFancyPkg"
,
"FancyUninstaller.tool"
)
}
...
...
@@ -287,7 +287,7 @@ describe Hbc::Artifact::Uninstall do
end
end
describe
"when using early_script"
do
context
"when using early_script"
do
let
(
:cask
)
{
Hbc
::
CaskLoader
.
load_from_file
(
TEST_FIXTURE_DIR
/
"cask/Casks/with-uninstall-early-script.rb"
)
}
let
(
:script_pathname
)
{
cask
.
staged_path
.
join
(
"MyFancyPkg"
,
"FancyUninstaller.tool"
)
}
...
...
@@ -302,7 +302,7 @@ describe Hbc::Artifact::Uninstall do
end
end
describe
"when using login_item"
do
context
"when using login_item"
do
let
(
:cask
)
{
Hbc
::
CaskLoader
.
load_from_file
(
TEST_FIXTURE_DIR
/
"cask/Casks/with-uninstall-login-item.rb"
)
}
it
"can uninstall"
do
...
...
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