chefspec 5.2.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/README.md +3 -3
- data/chefspec.gemspec +1 -1
- data/examples/bff_package/recipes/install.rb +13 -0
- data/examples/bff_package/recipes/purge.rb +13 -0
- data/examples/bff_package/recipes/remove.rb +13 -0
- data/examples/bff_package/recipes/upgrade.rb +13 -0
- data/examples/bff_package/spec/install_spec.rb +23 -0
- data/examples/bff_package/spec/purge_spec.rb +19 -0
- data/examples/bff_package/spec/remove_spec.rb +19 -0
- data/examples/bff_package/spec/upgrade_spec.rb +19 -0
- data/examples/homebrew_package/recipes/install.rb +13 -0
- data/examples/homebrew_package/recipes/purge.rb +13 -0
- data/examples/homebrew_package/recipes/remove.rb +13 -0
- data/examples/homebrew_package/recipes/upgrade.rb +13 -0
- data/examples/homebrew_package/spec/install_spec.rb +23 -0
- data/examples/homebrew_package/spec/purge_spec.rb +19 -0
- data/examples/homebrew_package/spec/remove_spec.rb +19 -0
- data/examples/homebrew_package/spec/upgrade_spec.rb +19 -0
- data/examples/launchd/recipes/create.rb +5 -0
- data/examples/launchd/recipes/create_if_missing.rb +3 -0
- data/examples/launchd/recipes/delete.rb +3 -0
- data/examples/launchd/recipes/disable.rb +3 -0
- data/examples/launchd/recipes/enable.rb +3 -0
- data/examples/launchd/spec/create_if_missing_spec.rb +10 -0
- data/examples/launchd/spec/create_spec.rb +14 -0
- data/examples/launchd/spec/delete_spec.rb +10 -0
- data/examples/launchd/spec/disable_spec.rb +10 -0
- data/examples/launchd/spec/enable_spec.rb +10 -0
- data/examples/openbsd_package/recipes/install.rb +13 -0
- data/examples/openbsd_package/recipes/purge.rb +13 -0
- data/examples/openbsd_package/recipes/remove.rb +13 -0
- data/examples/openbsd_package/recipes/upgrade.rb +13 -0
- data/examples/openbsd_package/spec/install_spec.rb +23 -0
- data/examples/openbsd_package/spec/purge_spec.rb +19 -0
- data/examples/openbsd_package/spec/remove_spec.rb +19 -0
- data/examples/openbsd_package/spec/upgrade_spec.rb +19 -0
- data/examples/osx_profile/recipes/install.rb +8 -0
- data/examples/osx_profile/recipes/remove.rb +8 -0
- data/examples/osx_profile/spec/install_spec.rb +15 -0
- data/examples/osx_profile/spec/remove_spec.rb +13 -0
- data/examples/paludis_package/recipes/install.rb +13 -0
- data/examples/paludis_package/recipes/purge.rb +13 -0
- data/examples/paludis_package/recipes/remove.rb +13 -0
- data/examples/paludis_package/recipes/upgrade.rb +13 -0
- data/examples/paludis_package/spec/install_spec.rb +23 -0
- data/examples/paludis_package/spec/purge_spec.rb +19 -0
- data/examples/paludis_package/spec/remove_spec.rb +19 -0
- data/examples/paludis_package/spec/upgrade_spec.rb +19 -0
- data/examples/ruby_block/recipes/create.rb +8 -0
- data/examples/ruby_block/spec/create_spec.rb +13 -0
- data/examples/script/recipes/run_ksh.rb +13 -0
- data/examples/script/spec/run_ksh_spec.rb +23 -0
- data/examples/solaris_package/recipes/upgrade.rb +13 -0
- data/examples/solaris_package/spec/upgrade_spec.rb +19 -0
- data/examples/systemd_unit/recipes/create.rb +3 -0
- data/examples/systemd_unit/recipes/delete.rb +3 -0
- data/examples/systemd_unit/recipes/disable.rb +3 -0
- data/examples/systemd_unit/recipes/enable.rb +3 -0
- data/examples/systemd_unit/recipes/mask.rb +3 -0
- data/examples/systemd_unit/recipes/reload_or_restart.rb +3 -0
- data/examples/systemd_unit/recipes/reload_or_try_restart.rb +3 -0
- data/examples/systemd_unit/recipes/restart.rb +3 -0
- data/examples/systemd_unit/recipes/start.rb +3 -0
- data/examples/systemd_unit/recipes/stop.rb +3 -0
- data/examples/systemd_unit/recipes/try_restart.rb +3 -0
- data/examples/systemd_unit/recipes/unmask.rb +3 -0
- data/examples/systemd_unit/spec/create_spec.rb +10 -0
- data/examples/systemd_unit/spec/delete_spec.rb +10 -0
- data/examples/systemd_unit/spec/disable_spec.rb +10 -0
- data/examples/systemd_unit/spec/enable_spec.rb +10 -0
- data/examples/systemd_unit/spec/mask_spec.rb +10 -0
- data/examples/systemd_unit/spec/reload_or_restart_spec.rb +10 -0
- data/examples/systemd_unit/spec/reload_or_try_restart_spec.rb +10 -0
- data/examples/systemd_unit/spec/restart_spec.rb +10 -0
- data/examples/systemd_unit/spec/start_spec.rb +10 -0
- data/examples/systemd_unit/spec/stop_spec.rb +10 -0
- data/examples/systemd_unit/spec/try_restart_spec.rb +10 -0
- data/examples/systemd_unit/spec/unmask_spec.rb +10 -0
- data/examples/zypper_package/recipes/install.rb +13 -0
- data/examples/zypper_package/recipes/purge.rb +13 -0
- data/examples/zypper_package/recipes/remove.rb +13 -0
- data/examples/zypper_package/recipes/upgrade.rb +13 -0
- data/examples/zypper_package/spec/install_spec.rb +23 -0
- data/examples/zypper_package/spec/purge_spec.rb +19 -0
- data/examples/zypper_package/spec/remove_spec.rb +19 -0
- data/examples/zypper_package/spec/upgrade_spec.rb +19 -0
- data/features/attributes.feature +1 -1
- data/features/bff_package.feature +12 -0
- data/features/chocolatey_package.feature +1 -0
- data/features/compile_time.feature +1 -1
- data/features/dsc_resource.feature +1 -0
- data/features/homebrew_package.feature +12 -0
- data/features/launchd.feature +23 -0
- data/features/openbsd_package.feature +14 -0
- data/features/osx_profile.feature +19 -0
- data/features/paludis_package.feature +14 -0
- data/features/roles.feature +1 -1
- data/features/ruby_block.feature +1 -0
- data/features/script.feature +8 -0
- data/features/solaris_package.feature +1 -0
- data/features/systemd_unit.feature +33 -0
- data/features/windows_package.feature +1 -0
- data/features/zypper_package.feature +18 -0
- data/lib/chefspec/api.rb +8 -0
- data/lib/chefspec/api/bff_package.rb +154 -0
- data/lib/chefspec/api/homebrew_package.rb +154 -0
- data/lib/chefspec/api/launchd.rb +151 -0
- data/lib/chefspec/api/openbsd_package.rb +155 -0
- data/lib/chefspec/api/osx_profile.rb +63 -0
- data/lib/chefspec/api/paludis_package.rb +155 -0
- data/lib/chefspec/api/ruby_block.rb +31 -0
- data/lib/chefspec/api/script.rb +39 -0
- data/lib/chefspec/api/solaris_package.rb +37 -0
- data/lib/chefspec/api/systemd_unit.rb +353 -0
- data/lib/chefspec/api/zypper_package.rb +154 -0
- data/lib/chefspec/version.rb +1 -1
- metadata +111 -3
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
openbsd_package 'default_action'
|
|
2
|
+
|
|
3
|
+
openbsd_package 'explicit_action' do
|
|
4
|
+
action :install
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
openbsd_package 'with_attributes' do
|
|
8
|
+
version '1.0.0'
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
openbsd_package 'specifying the identity attribute' do
|
|
12
|
+
package_name 'identity_attribute'
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
openbsd_package 'explicit_action' do
|
|
2
|
+
action :purge
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
openbsd_package 'with_attributes' do
|
|
6
|
+
version '1.0.0'
|
|
7
|
+
action :purge
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
openbsd_package 'specifying the identity attribute' do
|
|
11
|
+
package_name 'identity_attribute'
|
|
12
|
+
action :purge
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
openbsd_package 'explicit_action' do
|
|
2
|
+
action :remove
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
openbsd_package 'with_attributes' do
|
|
6
|
+
version '1.0.0'
|
|
7
|
+
action :remove
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
openbsd_package 'specifying the identity attribute' do
|
|
11
|
+
package_name 'identity_attribute'
|
|
12
|
+
action :remove
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
openbsd_package 'explicit_action' do
|
|
2
|
+
action :upgrade
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
openbsd_package 'with_attributes' do
|
|
6
|
+
version '1.0.0'
|
|
7
|
+
action :upgrade
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
openbsd_package 'specifying the identity attribute' do
|
|
11
|
+
package_name 'identity_attribute'
|
|
12
|
+
action :upgrade
|
|
13
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require 'chefspec'
|
|
2
|
+
|
|
3
|
+
describe 'openbsd_package::install' do
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
|
5
|
+
|
|
6
|
+
it 'installs a openbsd_package with the default action' do
|
|
7
|
+
expect(chef_run).to install_openbsd_package('default_action')
|
|
8
|
+
expect(chef_run).to_not install_openbsd_package('not_default_action')
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it 'installs a openbsd_package with an explicit action' do
|
|
12
|
+
expect(chef_run).to install_openbsd_package('explicit_action')
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it 'installs a openbsd_package with attributes' do
|
|
16
|
+
expect(chef_run).to install_openbsd_package('with_attributes').with(version: '1.0.0')
|
|
17
|
+
expect(chef_run).to_not install_openbsd_package('with_attributes').with(version: '1.2.3')
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it 'installs a openbsd_package when specifying the identity attribute' do
|
|
21
|
+
expect(chef_run).to install_openbsd_package('identity_attribute')
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'chefspec'
|
|
2
|
+
|
|
3
|
+
describe 'openbsd_package::purge' do
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
|
5
|
+
|
|
6
|
+
it 'purges a openbsd_package with an explicit action' do
|
|
7
|
+
expect(chef_run).to purge_openbsd_package('explicit_action')
|
|
8
|
+
expect(chef_run).to_not purge_openbsd_package('not_explicit_action')
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it 'purges a openbsd_package with attributes' do
|
|
12
|
+
expect(chef_run).to purge_openbsd_package('with_attributes').with(version: '1.0.0')
|
|
13
|
+
expect(chef_run).to_not purge_openbsd_package('with_attributes').with(version: '1.2.3')
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'purges a openbsd_package when specifying the identity attribute' do
|
|
17
|
+
expect(chef_run).to purge_openbsd_package('identity_attribute')
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'chefspec'
|
|
2
|
+
|
|
3
|
+
describe 'openbsd_package::remove' do
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
|
5
|
+
|
|
6
|
+
it 'removes a openbsd_package with an explicit action' do
|
|
7
|
+
expect(chef_run).to remove_openbsd_package('explicit_action')
|
|
8
|
+
expect(chef_run).to_not remove_openbsd_package('not_explicit_action')
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it 'removes a openbsd_package with attributes' do
|
|
12
|
+
expect(chef_run).to remove_openbsd_package('with_attributes').with(version: '1.0.0')
|
|
13
|
+
expect(chef_run).to_not remove_openbsd_package('with_attributes').with(version: '1.2.3')
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'removes a openbsd_package when specifying the identity attribute' do
|
|
17
|
+
expect(chef_run).to remove_openbsd_package('identity_attribute')
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'chefspec'
|
|
2
|
+
|
|
3
|
+
describe 'openbsd_package::upgrade' do
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
|
5
|
+
|
|
6
|
+
it 'upgrades a openbsd_package with an explicit action' do
|
|
7
|
+
expect(chef_run).to upgrade_openbsd_package('explicit_action')
|
|
8
|
+
expect(chef_run).to_not upgrade_openbsd_package('not_explicit_action')
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it 'upgrades a openbsd_package with attributes' do
|
|
12
|
+
expect(chef_run).to upgrade_openbsd_package('with_attributes').with(version: '1.0.0')
|
|
13
|
+
expect(chef_run).to_not upgrade_openbsd_package('with_attributes').with(version: '1.2.3')
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'upgrades a openbsd_package when specifying the identity attribute' do
|
|
17
|
+
expect(chef_run).to upgrade_openbsd_package('identity_attribute')
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require 'chefspec'
|
|
2
|
+
|
|
3
|
+
describe 'osx_profile::install' do
|
|
4
|
+
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.11.1').converge(described_recipe) }
|
|
5
|
+
|
|
6
|
+
it 'installs an osx_profile with an explicit action' do
|
|
7
|
+
expect(chef_run).to install_osx_profile('explicit_action')
|
|
8
|
+
expect(chef_run).to_not install_osx_profile('not_explicit_action')
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it 'starts an osx_profile with an implicit_action action' do
|
|
12
|
+
expect(chef_run).to install_osx_profile('implicit_action')
|
|
13
|
+
expect(chef_run).to_not install_osx_profile('other_profile')
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'chefspec'
|
|
2
|
+
|
|
3
|
+
describe 'osx_profile::remove' do
|
|
4
|
+
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.11.1').converge(described_recipe) }
|
|
5
|
+
|
|
6
|
+
it 'removes an osx_profile from the resource name' do
|
|
7
|
+
expect(chef_run).to remove_osx_profile('specifying profile')
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it 'removes an osx_profile from the profile property' do
|
|
11
|
+
expect(chef_run).to remove_osx_profile('screensaver/com.company.screensaver.mobileconfig')
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
paludis_package 'default_action'
|
|
2
|
+
|
|
3
|
+
paludis_package 'explicit_action' do
|
|
4
|
+
action :install
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
paludis_package 'with_attributes' do
|
|
8
|
+
version '1.0.0'
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
paludis_package 'specifying the identity attribute' do
|
|
12
|
+
package_name 'identity_attribute'
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
paludis_package 'explicit_action' do
|
|
2
|
+
action :purge
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
paludis_package 'with_attributes' do
|
|
6
|
+
version '1.0.0'
|
|
7
|
+
action :purge
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
paludis_package 'specifying the identity attribute' do
|
|
11
|
+
package_name 'identity_attribute'
|
|
12
|
+
action :purge
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
paludis_package 'explicit_action' do
|
|
2
|
+
action :remove
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
paludis_package 'with_attributes' do
|
|
6
|
+
version '1.0.0'
|
|
7
|
+
action :remove
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
paludis_package 'specifying the identity attribute' do
|
|
11
|
+
package_name 'identity_attribute'
|
|
12
|
+
action :remove
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
paludis_package 'explicit_action' do
|
|
2
|
+
action :upgrade
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
paludis_package 'with_attributes' do
|
|
6
|
+
version '1.0.0'
|
|
7
|
+
action :upgrade
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
paludis_package 'specifying the identity attribute' do
|
|
11
|
+
package_name 'identity_attribute'
|
|
12
|
+
action :upgrade
|
|
13
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require 'chefspec'
|
|
2
|
+
|
|
3
|
+
describe 'paludis_package::install' do
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
|
|
5
|
+
|
|
6
|
+
it 'installs a paludis_package with the default action' do
|
|
7
|
+
expect(chef_run).to install_paludis_package('default_action')
|
|
8
|
+
expect(chef_run).to_not install_paludis_package('not_default_action')
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it 'installs a paludis_package with an explicit action' do
|
|
12
|
+
expect(chef_run).to install_paludis_package('explicit_action')
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it 'installs a paludis_package with attributes' do
|
|
16
|
+
expect(chef_run).to install_paludis_package('with_attributes').with(version: '1.0.0')
|
|
17
|
+
expect(chef_run).to_not install_paludis_package('with_attributes').with(version: '1.2.3')
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it 'installs a paludis_package when specifying the identity attribute' do
|
|
21
|
+
expect(chef_run).to install_paludis_package('identity_attribute')
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'chefspec'
|
|
2
|
+
|
|
3
|
+
describe 'paludis_package::purge' do
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
|
|
5
|
+
|
|
6
|
+
it 'purges a paludis_package with an explicit action' do
|
|
7
|
+
expect(chef_run).to purge_paludis_package('explicit_action')
|
|
8
|
+
expect(chef_run).to_not purge_paludis_package('not_explicit_action')
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it 'purges a paludis_package with attributes' do
|
|
12
|
+
expect(chef_run).to purge_paludis_package('with_attributes').with(version: '1.0.0')
|
|
13
|
+
expect(chef_run).to_not purge_paludis_package('with_attributes').with(version: '1.2.3')
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'purges a paludis_package when specifying the identity attribute' do
|
|
17
|
+
expect(chef_run).to purge_paludis_package('identity_attribute')
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'chefspec'
|
|
2
|
+
|
|
3
|
+
describe 'paludis_package::remove' do
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
|
|
5
|
+
|
|
6
|
+
it 'removes a paludis_package with an explicit action' do
|
|
7
|
+
expect(chef_run).to remove_paludis_package('explicit_action')
|
|
8
|
+
expect(chef_run).to_not remove_paludis_package('not_explicit_action')
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it 'removes a paludis_package with attributes' do
|
|
12
|
+
expect(chef_run).to remove_paludis_package('with_attributes').with(version: '1.0.0')
|
|
13
|
+
expect(chef_run).to_not remove_paludis_package('with_attributes').with(version: '1.2.3')
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'removes a paludis_package when specifying the identity attribute' do
|
|
17
|
+
expect(chef_run).to remove_paludis_package('identity_attribute')
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'chefspec'
|
|
2
|
+
|
|
3
|
+
describe 'paludis_package::upgrade' do
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
|
|
5
|
+
|
|
6
|
+
it 'upgrades a paludis_package with an explicit action' do
|
|
7
|
+
expect(chef_run).to upgrade_paludis_package('explicit_action')
|
|
8
|
+
expect(chef_run).to_not upgrade_paludis_package('not_explicit_action')
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it 'upgrades a paludis_package with attributes' do
|
|
12
|
+
expect(chef_run).to upgrade_paludis_package('with_attributes').with(version: '1.0.0')
|
|
13
|
+
expect(chef_run).to_not upgrade_paludis_package('with_attributes').with(version: '1.2.3')
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'upgrades a paludis_package when specifying the identity attribute' do
|
|
17
|
+
expect(chef_run).to upgrade_paludis_package('identity_attribute')
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'chefspec'
|
|
2
|
+
|
|
3
|
+
describe 'ruby_block::create' do
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
|
5
|
+
|
|
6
|
+
it 'creates a ruby_block with an explicit action' do
|
|
7
|
+
expect(chef_run).to create_ruby_block('explicit_action')
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it 'creates a ruby_block when specifying the identity attribute' do
|
|
11
|
+
expect(chef_run).to create_ruby_block('identity_attribute')
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require 'chefspec'
|
|
2
|
+
|
|
3
|
+
describe 'script::run_ksh' do
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
|
5
|
+
|
|
6
|
+
it 'runs a ksh script with the default action' do
|
|
7
|
+
expect(chef_run).to run_ksh('default_action')
|
|
8
|
+
expect(chef_run).to_not run_ksh('not_default_action')
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it 'runs a ksh script with an explicit action' do
|
|
12
|
+
expect(chef_run).to run_ksh('explicit_action')
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it 'runs a ksh script with attributes' do
|
|
16
|
+
expect(chef_run).to run_ksh('with_attributes').with(creates: 'creates')
|
|
17
|
+
expect(chef_run).to_not run_ksh('with_attributes').with(creates: 'bacon')
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it 'runs a ksh script when specifying the identity attribute' do
|
|
21
|
+
expect(chef_run).to run_ksh('identity_attribute')
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
solaris_package 'explicit_action' do
|
|
2
|
+
action :upgrade
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
solaris_package 'with_attributes' do
|
|
6
|
+
version '1.0.0'
|
|
7
|
+
action :upgrade
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
solaris_package 'specifying the identity attribute' do
|
|
11
|
+
package_name 'identity_attribute'
|
|
12
|
+
action :upgrade
|
|
13
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'chefspec'
|
|
2
|
+
|
|
3
|
+
describe 'solaris_package::upgrade' do
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
|
5
|
+
|
|
6
|
+
it 'upgrades a solaris_package with an explicit action' do
|
|
7
|
+
expect(chef_run).to upgrade_solaris_package('explicit_action')
|
|
8
|
+
expect(chef_run).to_not upgrade_solaris_package('not_explicit_action')
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it 'upgrades a solaris_package with attributes' do
|
|
12
|
+
expect(chef_run).to upgrade_solaris_package('with_attributes').with(version: '1.0.0')
|
|
13
|
+
expect(chef_run).to_not upgrade_solaris_package('with_attributes').with(version: '1.2.3')
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'upgrades a solaris_package when specifying the identity attribute' do
|
|
17
|
+
expect(chef_run).to upgrade_solaris_package('identity_attribute')
|
|
18
|
+
end
|
|
19
|
+
end
|