|
15 | 15 |
|
16 | 16 | context 'with defaults for all parameters' do
|
17 | 17 | it { is_expected.to compile.with_all_deps }
|
18 |
| - it { is_expected.to contain_exec('plugin install foo/plugin:latest').with_command(%r{docker plugin install}).with_unless(%r{docker ls --format='{{.PluginReference}}' | grep -w foo/plugin:latest}) } |
| 18 | + it { is_expected.to contain_exec('plugin install foo/plugin:latest').with_command(%r{docker plugin install}) } |
| 19 | + it { is_expected.to contain_exec('plugin install foo/plugin:latest').with_unless(%r{docker ls --format='{{.PluginReference}}' | grep -w foo/plugin:latest}) } |
19 | 20 | end
|
20 | 21 |
|
21 | 22 | context 'with enabled => false' do
|
22 | 23 | let(:params) { { 'enabled' => false } }
|
23 | 24 |
|
24 | 25 | it { is_expected.to compile.with_all_deps }
|
25 |
| - it { is_expected.to contain_exec('disable foo/plugin:latest').with_command(%r{docker plugin disable}).with_unless(%r{docker ls --format='{{.PluginReference}}' | grep -w foo/plugin:latest}) } |
| 26 | + it { is_expected.to contain_exec('disable foo/plugin:latest').with_command(%r{docker plugin disable}) } |
| 27 | + it { is_expected.to contain_exec('disable foo/plugin:latest').with_unless(%r{docker ls --format='{{.PluginReference}}' | grep -w foo/plugin:latest}) } |
26 | 28 | end
|
27 | 29 |
|
28 | 30 | context 'with ensure => absent' do
|
29 | 31 | let(:params) { { 'ensure' => 'absent' } }
|
30 | 32 |
|
31 | 33 | it { is_expected.to compile.with_all_deps }
|
32 |
| - it { is_expected.to contain_exec('plugin remove foo/plugin:latest').with_command(%r{docker plugin rm}).with_onlyif(%r{docker ls --format='{{.PluginReference}}' | grep -w foo/plugin:latest}) } |
| 34 | + it { is_expected.to contain_exec('plugin remove foo/plugin:latest').with_command(%r{docker plugin rm}) } |
| 35 | + it { is_expected.to contain_exec('plugin remove foo/plugin:latest').with_onlyif(%r{docker ls --format='{{.PluginReference}}' | grep -w foo/plugin:latest}) } |
33 | 36 | end
|
34 | 37 |
|
35 | 38 | context 'with alias => foo-plugin' do
|
36 | 39 | let(:params) { { 'plugin_alias' => 'foo-plugin' } }
|
37 | 40 |
|
38 |
| - it { is_expected.to contain_exec('plugin install foo/plugin:latest').with_command(%r{docker plugin install}).with_unless(%r{docker ls --format='{{.PluginReference}}' | grep -w foo/plugin:latest}) } |
| 41 | + it { is_expected.to contain_exec('plugin install foo/plugin:latest').with_command(%r{docker plugin install}) } |
| 42 | + it { is_expected.to contain_exec('plugin install foo/plugin:latest').with_unless(%r{docker ls --format='{{.PluginReference}}' | grep -w foo/plugin:latest}) } |
39 | 43 | end
|
40 |
| - |
41 | 44 | end
|
0 commit comments