-
Notifications
You must be signed in to change notification settings - Fork 321
/
Copy pathplugin_spec.rb
42 lines (34 loc) · 943 Bytes
/
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
31
32
33
34
35
36
37
38
39
40
41
42
# frozen_string_literal: true
require 'spec_helper_acceptance'
broken = false
command = 'docker'
plugin_name = 'vieux/sshfs'
if os[:family] == 'windows'
puts 'Not implemented on Windows'
broken = true
else
docker_args = ''
end
describe 'docker plugin', win_broken: broken, skip: is_aarch? do
before(:all) do
install_code = "class { 'docker': #{docker_args}}"
apply_manifest(install_code, catch_failures: true)
end
it "#{command} plugin --help" do
run_shell("#{command} plugin --help", expect_failures: false)
end
context 'manage a plugin' do
after(:all) do
run_shell("#{command} plugin rm -f #{plugin_name}")
end
it 'is idempotent' do
pp = <<-MANIFEST
docker::plugin { '#{plugin_name}':}
MANIFEST
idempotent_apply(pp)
end
it 'has installed a plugin' do
run_shell("#{command} plugin inspect #{plugin_name}", expect_failures: false)
end
end
end