Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9125544
plugin_spec.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
plugin_spec.rb
View Options
require
'spec_helper'
describe
'docker::plugin'
,
type
:
:define
do
let
(
:title
)
{
'foo/plugin:latest'
}
let
(
:facts
)
do
{
osfamily
:
'Debian'
,
operatingsystem
:
'Debian'
,
lsbdistid
:
'Debian'
,
lsbdistcodename
:
'jessie'
,
kernelrelease
:
'3.2.0-4-amd64'
,
operatingsystemmajrelease
:
'8'
,
}
end
context
'with defaults for all parameters'
do
it
{
is_expected
.
to
compile
.
with_all_deps
}
it
{
is_expected
.
to
contain_exec
(
'plugin install foo/plugin:latest'
)
.
with_command
(
%r{docker plugin install}
)
}
it
{
is_expected
.
to
contain_exec
(
'plugin install foo/plugin:latest'
)
.
with_unless
(
%r{docker ls --format='{{.PluginReference}}' | grep -w foo/plugin:latest}
)
}
end
context
'with enabled => false'
do
let
(
:params
)
{
{
'enabled'
=>
false
}
}
it
{
is_expected
.
to
compile
.
with_all_deps
}
it
{
is_expected
.
to
contain_exec
(
'disable foo/plugin:latest'
)
.
with_command
(
%r{docker plugin disable}
)
}
it
{
is_expected
.
to
contain_exec
(
'disable foo/plugin:latest'
)
.
with_unless
(
%r{docker ls --format='{{.PluginReference}}' | grep -w foo/plugin:latest}
)
}
end
context
'with ensure => absent'
do
let
(
:params
)
{
{
'ensure'
=>
'absent'
}
}
it
{
is_expected
.
to
compile
.
with_all_deps
}
it
{
is_expected
.
to
contain_exec
(
'plugin remove foo/plugin:latest'
)
.
with_command
(
%r{docker plugin rm}
)
}
it
{
is_expected
.
to
contain_exec
(
'plugin remove foo/plugin:latest'
)
.
with_onlyif
(
%r{docker ls --format='{{.PluginReference}}' | grep -w foo/plugin:latest}
)
}
end
context
'with alias => foo-plugin'
do
let
(
:params
)
{
{
'plugin_alias'
=>
'foo-plugin'
}
}
it
{
is_expected
.
to
contain_exec
(
'plugin install foo/plugin:latest'
)
.
with_command
(
%r{docker plugin install}
)
}
it
{
is_expected
.
to
contain_exec
(
'plugin install foo/plugin:latest'
)
.
with_unless
(
%r{docker ls --format='{{.PluginReference}}' | grep -w foo/plugin:latest}
)
}
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Sat, Jun 21, 9:02 PM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3373560
Attached To
R205 puppet-puppetlabs-docker
Event Timeline
Log In to Comment