forked from puppetlabs/puppetlabs-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin_spec.rb
30 lines (26 loc) · 1.06 KB
/
plugin_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require 'spec_helper'
describe 'docker::plugin', :type => :define do
let(:title) { 'foo/plugin:latest' }
let(:facts) { {
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:lsbdistid => 'Debian',
:lsbdistcodename => 'jessie',
:kernelrelease => '3.2.0-4-amd64',
:operatingsystemmajrelease => '8',
} }
context 'with defaults for all parameters' do
it { is_expected.to compile.with_all_deps }
it { should contain_exec('plugin install foo/plugin:latest').with_command(/docker plugin install/) }
end
context 'with enabled => false' do
let(:params) { { 'enabled' => false, } }
it { is_expected.to compile.with_all_deps }
it { should contain_exec("disable foo/plugin:latest").with_command(/docker plugin disable/) }
end
context 'with ensure => absent' do
let(:params) { { 'ensure' => 'absent'} }
it { is_expected.to compile.with_all_deps }
it { should contain_exec('plugin remove foo/plugin:latest').with_command(/docker plugin rm/) }
end
end