Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9123786
compose_windows_spec.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
compose_windows_spec.rb
View Options
require
'spec_helper'
describe
'docker::compose'
,
:type
=>
:class
do
let
(
:facts
)
do
{
:architecture
=>
'amd64'
,
:osfamily
=>
'windows'
,
:operatingsystem
=>
'windows'
,
:kernel
=>
'windows'
,
:kernelrelease
=>
'10.0.14393'
,
:operatingsystemrelease
=>
'2016'
,
:operatingsystemmajrelease
=>
'2016'
,
:docker_program_data_path
=>
'C:/ProgramData'
,
:docker_program_files_path
=>
'C:/Program Files'
,
:docker_systemroot
=>
'C:/Windows'
,
:docker_user_temp_path
=>
'C:/Users/Administrator/AppData/Local/Temp'
,
:os
=>
{
:family
=>
'windows'
,
:name
=>
'windows'
,
:release
=>
{
:major
=>
'2016'
,
:full
=>
'2016'
}
}
}
end
it
{
is_expected
.
to
compile
}
context
'with defaults for all parameters'
do
it
{
should
compile
.
with_all_deps
}
it
{
should
contain_file
(
'C:/Program Files/Docker/docker-compose.exe'
)
.
with
(
'ensure'
=>
'link'
,
'target'
=>
'C:/Program Files/Docker/docker-compose-1.21.2.exe'
,
'require'
=>
'Exec[Install Docker Compose 1.21.2]'
)}
end
context
'with ensure => absent'
do
let
(
:params
)
{
{
:ensure
=>
'absent'
}
}
it
{
should
contain_file
(
'C:/Program Files/Docker/docker-compose-1.21.2.exe'
)
.
with_ensure
(
'absent'
)
}
it
{
should
contain_file
(
'C:/Program Files/Docker/docker-compose.exe'
)
.
with_ensure
(
'absent'
)
}
end
context
'when no proxy is provided'
do
let
(
:params
)
{
{
:version
=>
'1.7.0'
}
}
it
{
is_expected
.
to
contain_exec
(
'Install Docker Compose 1.7.0'
)
}
end
context
'when proxy is provided'
do
let
(
:params
)
{
{
:proxy
=>
'http://proxy.example.org:3128/'
,
:version
=>
'1.7.0'
}
}
it
{
is_expected
.
to
compile
}
it
{
is_expected
.
to
contain_exec
(
'Install Docker Compose 1.7.0'
)
}
end
context
'when proxy is not a http proxy'
do
let
(
:params
)
{
{
:proxy
=>
'this is not a URL'
}
}
it
do
expect
{
is_expected
.
to
compile
}
.
to
raise_error
(
/does not match/
)
end
end
context
'when proxy contains username and password'
do
let
(
:params
)
{
{
:proxy
=>
'http://user:password@proxy.example.org:3128/'
,
:version
=>
'1.7.0'
}
}
it
{
is_expected
.
to
compile
}
it
{
is_expected
.
to
contain_exec
(
'Install Docker Compose 1.7.0'
)
}
end
context
'when proxy IP is provided'
do
let
(
:params
)
{
{
:proxy
=>
'http://10.10.10.10:3128/'
,
:version
=>
'1.7.0'
}
}
it
{
is_expected
.
to
compile
}
it
{
is_expected
.
to
contain_exec
(
'Install Docker Compose 1.7.0'
)
}
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Sat, Jun 21, 6:08 PM (2 w, 3 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3373688
Attached To
R205 puppet-puppetlabs-docker
Event Timeline
Log In to Comment