chefspec 5.2.0 → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +3 -3
  4. data/chefspec.gemspec +1 -1
  5. data/examples/bff_package/recipes/install.rb +13 -0
  6. data/examples/bff_package/recipes/purge.rb +13 -0
  7. data/examples/bff_package/recipes/remove.rb +13 -0
  8. data/examples/bff_package/recipes/upgrade.rb +13 -0
  9. data/examples/bff_package/spec/install_spec.rb +23 -0
  10. data/examples/bff_package/spec/purge_spec.rb +19 -0
  11. data/examples/bff_package/spec/remove_spec.rb +19 -0
  12. data/examples/bff_package/spec/upgrade_spec.rb +19 -0
  13. data/examples/homebrew_package/recipes/install.rb +13 -0
  14. data/examples/homebrew_package/recipes/purge.rb +13 -0
  15. data/examples/homebrew_package/recipes/remove.rb +13 -0
  16. data/examples/homebrew_package/recipes/upgrade.rb +13 -0
  17. data/examples/homebrew_package/spec/install_spec.rb +23 -0
  18. data/examples/homebrew_package/spec/purge_spec.rb +19 -0
  19. data/examples/homebrew_package/spec/remove_spec.rb +19 -0
  20. data/examples/homebrew_package/spec/upgrade_spec.rb +19 -0
  21. data/examples/launchd/recipes/create.rb +5 -0
  22. data/examples/launchd/recipes/create_if_missing.rb +3 -0
  23. data/examples/launchd/recipes/delete.rb +3 -0
  24. data/examples/launchd/recipes/disable.rb +3 -0
  25. data/examples/launchd/recipes/enable.rb +3 -0
  26. data/examples/launchd/spec/create_if_missing_spec.rb +10 -0
  27. data/examples/launchd/spec/create_spec.rb +14 -0
  28. data/examples/launchd/spec/delete_spec.rb +10 -0
  29. data/examples/launchd/spec/disable_spec.rb +10 -0
  30. data/examples/launchd/spec/enable_spec.rb +10 -0
  31. data/examples/openbsd_package/recipes/install.rb +13 -0
  32. data/examples/openbsd_package/recipes/purge.rb +13 -0
  33. data/examples/openbsd_package/recipes/remove.rb +13 -0
  34. data/examples/openbsd_package/recipes/upgrade.rb +13 -0
  35. data/examples/openbsd_package/spec/install_spec.rb +23 -0
  36. data/examples/openbsd_package/spec/purge_spec.rb +19 -0
  37. data/examples/openbsd_package/spec/remove_spec.rb +19 -0
  38. data/examples/openbsd_package/spec/upgrade_spec.rb +19 -0
  39. data/examples/osx_profile/recipes/install.rb +8 -0
  40. data/examples/osx_profile/recipes/remove.rb +8 -0
  41. data/examples/osx_profile/spec/install_spec.rb +15 -0
  42. data/examples/osx_profile/spec/remove_spec.rb +13 -0
  43. data/examples/paludis_package/recipes/install.rb +13 -0
  44. data/examples/paludis_package/recipes/purge.rb +13 -0
  45. data/examples/paludis_package/recipes/remove.rb +13 -0
  46. data/examples/paludis_package/recipes/upgrade.rb +13 -0
  47. data/examples/paludis_package/spec/install_spec.rb +23 -0
  48. data/examples/paludis_package/spec/purge_spec.rb +19 -0
  49. data/examples/paludis_package/spec/remove_spec.rb +19 -0
  50. data/examples/paludis_package/spec/upgrade_spec.rb +19 -0
  51. data/examples/ruby_block/recipes/create.rb +8 -0
  52. data/examples/ruby_block/spec/create_spec.rb +13 -0
  53. data/examples/script/recipes/run_ksh.rb +13 -0
  54. data/examples/script/spec/run_ksh_spec.rb +23 -0
  55. data/examples/solaris_package/recipes/upgrade.rb +13 -0
  56. data/examples/solaris_package/spec/upgrade_spec.rb +19 -0
  57. data/examples/systemd_unit/recipes/create.rb +3 -0
  58. data/examples/systemd_unit/recipes/delete.rb +3 -0
  59. data/examples/systemd_unit/recipes/disable.rb +3 -0
  60. data/examples/systemd_unit/recipes/enable.rb +3 -0
  61. data/examples/systemd_unit/recipes/mask.rb +3 -0
  62. data/examples/systemd_unit/recipes/reload_or_restart.rb +3 -0
  63. data/examples/systemd_unit/recipes/reload_or_try_restart.rb +3 -0
  64. data/examples/systemd_unit/recipes/restart.rb +3 -0
  65. data/examples/systemd_unit/recipes/start.rb +3 -0
  66. data/examples/systemd_unit/recipes/stop.rb +3 -0
  67. data/examples/systemd_unit/recipes/try_restart.rb +3 -0
  68. data/examples/systemd_unit/recipes/unmask.rb +3 -0
  69. data/examples/systemd_unit/spec/create_spec.rb +10 -0
  70. data/examples/systemd_unit/spec/delete_spec.rb +10 -0
  71. data/examples/systemd_unit/spec/disable_spec.rb +10 -0
  72. data/examples/systemd_unit/spec/enable_spec.rb +10 -0
  73. data/examples/systemd_unit/spec/mask_spec.rb +10 -0
  74. data/examples/systemd_unit/spec/reload_or_restart_spec.rb +10 -0
  75. data/examples/systemd_unit/spec/reload_or_try_restart_spec.rb +10 -0
  76. data/examples/systemd_unit/spec/restart_spec.rb +10 -0
  77. data/examples/systemd_unit/spec/start_spec.rb +10 -0
  78. data/examples/systemd_unit/spec/stop_spec.rb +10 -0
  79. data/examples/systemd_unit/spec/try_restart_spec.rb +10 -0
  80. data/examples/systemd_unit/spec/unmask_spec.rb +10 -0
  81. data/examples/zypper_package/recipes/install.rb +13 -0
  82. data/examples/zypper_package/recipes/purge.rb +13 -0
  83. data/examples/zypper_package/recipes/remove.rb +13 -0
  84. data/examples/zypper_package/recipes/upgrade.rb +13 -0
  85. data/examples/zypper_package/spec/install_spec.rb +23 -0
  86. data/examples/zypper_package/spec/purge_spec.rb +19 -0
  87. data/examples/zypper_package/spec/remove_spec.rb +19 -0
  88. data/examples/zypper_package/spec/upgrade_spec.rb +19 -0
  89. data/features/attributes.feature +1 -1
  90. data/features/bff_package.feature +12 -0
  91. data/features/chocolatey_package.feature +1 -0
  92. data/features/compile_time.feature +1 -1
  93. data/features/dsc_resource.feature +1 -0
  94. data/features/homebrew_package.feature +12 -0
  95. data/features/launchd.feature +23 -0
  96. data/features/openbsd_package.feature +14 -0
  97. data/features/osx_profile.feature +19 -0
  98. data/features/paludis_package.feature +14 -0
  99. data/features/roles.feature +1 -1
  100. data/features/ruby_block.feature +1 -0
  101. data/features/script.feature +8 -0
  102. data/features/solaris_package.feature +1 -0
  103. data/features/systemd_unit.feature +33 -0
  104. data/features/windows_package.feature +1 -0
  105. data/features/zypper_package.feature +18 -0
  106. data/lib/chefspec/api.rb +8 -0
  107. data/lib/chefspec/api/bff_package.rb +154 -0
  108. data/lib/chefspec/api/homebrew_package.rb +154 -0
  109. data/lib/chefspec/api/launchd.rb +151 -0
  110. data/lib/chefspec/api/openbsd_package.rb +155 -0
  111. data/lib/chefspec/api/osx_profile.rb +63 -0
  112. data/lib/chefspec/api/paludis_package.rb +155 -0
  113. data/lib/chefspec/api/ruby_block.rb +31 -0
  114. data/lib/chefspec/api/script.rb +39 -0
  115. data/lib/chefspec/api/solaris_package.rb +37 -0
  116. data/lib/chefspec/api/systemd_unit.rb +353 -0
  117. data/lib/chefspec/api/zypper_package.rb +154 -0
  118. data/lib/chefspec/version.rb +1 -1
  119. metadata +111 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a24e7cee64fcf2585e39638dea9663e33a205db
4
- data.tar.gz: 176b31a6d53d4998f8dd8d6e96239903eb7193e9
3
+ metadata.gz: cd963cf180a20e6c7271d54e58c941c719052754
4
+ data.tar.gz: cc514dca888b1a8c99fcd4e4c917dc56df2ff8e5
5
5
  SHA512:
6
- metadata.gz: 9f4105a75191604af70b05e9382b0ac6a3de9f0467701c2eb9a872132b736f9cbf0e3cc58ea85a602b4b9ecc9cf4ce858633b0def0547243c95cd3e364345dbc
7
- data.tar.gz: bad97b2abad711ace7f453e26fb843b1f7ba5175f013cf280b416bd1e801a43a6492d737765080afcb5951282a5bd467bc7ef850bbd799484e1109a6375b5761
6
+ metadata.gz: e3cc38869f14061cbe3b2ebaf3f6c46042429925b7495ef55b5471074f23a6afb435dd7aebfad101a4ffa943ef793fb28b176159a3bd5dd390365a3e7cd50e2c
7
+ data.tar.gz: 1f5f5cf99b9926d07232b850d195d2817c58200d773ca419e16dd7fe64b9f3f81c93ad5fa931835e2430eb05787a8e4df94f0cc03ecc9fc39b9e4bbfeb58ea03
@@ -1,5 +1,23 @@
1
1
  # CHANGELOG for ChefSpec
2
2
 
3
+ ## 5.3.0 (October 20, 2016)
4
+
5
+ IMPROVEMENTS
6
+
7
+ - Added all missing matchers for built-in chef-client resources
8
+
9
+ - osx_profile
10
+ - zypper_package
11
+ - systemd_unit
12
+ - openbsd_package
13
+ - launchd
14
+ - homebrew_package
15
+ - bff_package
16
+
17
+ BUG FIXES
18
+
19
+ - Fixed readme examples to properly specify the platform / platform version and to use a cache dir that will work on Windows
20
+
3
21
  ## 5.2.0 (September 21, 2016)
4
22
 
5
23
  IMPROVEMENTS
data/README.md CHANGED
@@ -54,7 +54,7 @@ the associated ChefSpec test might look like:
54
54
  require 'chefspec'
55
55
 
56
56
  describe 'example::default' do
57
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
57
+ let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
58
58
 
59
59
  it 'installs foo' do
60
60
  expect(chef_run).to install_package('foo')
@@ -88,7 +88,7 @@ RSpec.configure do |config|
88
88
  config.environment_path = '/var/environments'
89
89
 
90
90
  # Specify the path for Chef Solo file cache path (default: nil)
91
- config.file_cache_path = '/var/chef/cache'
91
+ config.file_cache_path = Chef::Config[:file_cache_path]
92
92
 
93
93
  # Specify the Chef log_level (default: :warn)
94
94
  config.log_level = :debug
@@ -120,7 +120,7 @@ ChefSpec::SoloRunner.new(cookbook_path: '/var/my/other/path', role_path: '/var/m
120
120
  # This can be overridden by passing the `file_cache_path` option.
121
121
  # Note: Resources containing `Chef::Config[:file_cache_path]` in their name or
122
122
  # attributes, will fail unless this option is specified.
123
- ChefSpec::SoloRunner.new(file_cache_path: '/var/chef/cache')
123
+ ChefSpec::SoloRunner.new(file_cache_path: Chef::Config[:file_cache_path])
124
124
 
125
125
  # Add debug log output
126
126
  ChefSpec::SoloRunner.new(log_level: :debug).converge(described_recipe)
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
23
23
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
24
24
  s.require_paths = ['lib']
25
25
 
26
- # ChefSpec requires Ruby 2.1+ since ChefDK uses 2.1.X
26
+ # ChefSpec requires Ruby 2.1+ since ChefDK uses 2.1+ (depending on version)
27
27
  s.required_ruby_version = '>= 2.1'
28
28
 
29
29
  s.add_dependency 'chef', '>= 12.0'
@@ -0,0 +1,13 @@
1
+ bff_package 'default_action'
2
+
3
+ bff_package 'explicit_action' do
4
+ action :install
5
+ end
6
+
7
+ bff_package 'with_attributes' do
8
+ version '1.0.0'
9
+ end
10
+
11
+ bff_package 'specifying the identity attribute' do
12
+ package_name 'identity_attribute'
13
+ end
@@ -0,0 +1,13 @@
1
+ bff_package 'explicit_action' do
2
+ action :purge
3
+ end
4
+
5
+ bff_package 'with_attributes' do
6
+ version '1.0.0'
7
+ action :purge
8
+ end
9
+
10
+ bff_package 'specifying the identity attribute' do
11
+ package_name 'identity_attribute'
12
+ action :purge
13
+ end
@@ -0,0 +1,13 @@
1
+ bff_package 'explicit_action' do
2
+ action :remove
3
+ end
4
+
5
+ bff_package 'with_attributes' do
6
+ version '1.0.0'
7
+ action :remove
8
+ end
9
+
10
+ bff_package 'specifying the identity attribute' do
11
+ package_name 'identity_attribute'
12
+ action :remove
13
+ end
@@ -0,0 +1,13 @@
1
+ bff_package 'explicit_action' do
2
+ action :upgrade
3
+ end
4
+
5
+ bff_package 'with_attributes' do
6
+ version '1.0.0'
7
+ action :upgrade
8
+ end
9
+
10
+ bff_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 'bff_package::install' do
4
+ let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
5
+
6
+ it 'installs a bff_package with the default action' do
7
+ expect(chef_run).to install_bff_package('default_action')
8
+ expect(chef_run).to_not install_bff_package('not_default_action')
9
+ end
10
+
11
+ it 'installs a bff_package with an explicit action' do
12
+ expect(chef_run).to install_bff_package('explicit_action')
13
+ end
14
+
15
+ it 'installs a bff_package with attributes' do
16
+ expect(chef_run).to install_bff_package('with_attributes').with(version: '1.0.0')
17
+ expect(chef_run).to_not install_bff_package('with_attributes').with(version: '1.2.3')
18
+ end
19
+
20
+ it 'installs a bff_package when specifying the identity attribute' do
21
+ expect(chef_run).to install_bff_package('identity_attribute')
22
+ end
23
+ end
@@ -0,0 +1,19 @@
1
+ require 'chefspec'
2
+
3
+ describe 'bff_package::purge' do
4
+ let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
5
+
6
+ it 'purges a bff_package with an explicit action' do
7
+ expect(chef_run).to purge_bff_package('explicit_action')
8
+ expect(chef_run).to_not purge_bff_package('not_explicit_action')
9
+ end
10
+
11
+ it 'purges a bff_package with attributes' do
12
+ expect(chef_run).to purge_bff_package('with_attributes').with(version: '1.0.0')
13
+ expect(chef_run).to_not purge_bff_package('with_attributes').with(version: '1.2.3')
14
+ end
15
+
16
+ it 'purges a bff_package when specifying the identity attribute' do
17
+ expect(chef_run).to purge_bff_package('identity_attribute')
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ require 'chefspec'
2
+
3
+ describe 'bff_package::remove' do
4
+ let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
5
+
6
+ it 'removes a bff_package with an explicit action' do
7
+ expect(chef_run).to remove_bff_package('explicit_action')
8
+ expect(chef_run).to_not remove_bff_package('not_explicit_action')
9
+ end
10
+
11
+ it 'removes a bff_package with attributes' do
12
+ expect(chef_run).to remove_bff_package('with_attributes').with(version: '1.0.0')
13
+ expect(chef_run).to_not remove_bff_package('with_attributes').with(version: '1.2.3')
14
+ end
15
+
16
+ it 'removes a bff_package when specifying the identity attribute' do
17
+ expect(chef_run).to remove_bff_package('identity_attribute')
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ require 'chefspec'
2
+
3
+ describe 'bff_package::upgrade' do
4
+ let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
5
+
6
+ it 'upgrades a bff_package with an explicit action' do
7
+ expect(chef_run).to upgrade_bff_package('explicit_action')
8
+ expect(chef_run).to_not upgrade_bff_package('not_explicit_action')
9
+ end
10
+
11
+ it 'upgrades a bff_package with attributes' do
12
+ expect(chef_run).to upgrade_bff_package('with_attributes').with(version: '1.0.0')
13
+ expect(chef_run).to_not upgrade_bff_package('with_attributes').with(version: '1.2.3')
14
+ end
15
+
16
+ it 'upgrades a bff_package when specifying the identity attribute' do
17
+ expect(chef_run).to upgrade_bff_package('identity_attribute')
18
+ end
19
+ end
@@ -0,0 +1,13 @@
1
+ homebrew_package 'default_action'
2
+
3
+ homebrew_package 'explicit_action' do
4
+ action :install
5
+ end
6
+
7
+ homebrew_package 'with_attributes' do
8
+ version '1.0.0'
9
+ end
10
+
11
+ homebrew_package 'specifying the identity attribute' do
12
+ package_name 'identity_attribute'
13
+ end
@@ -0,0 +1,13 @@
1
+ homebrew_package 'explicit_action' do
2
+ action :purge
3
+ end
4
+
5
+ homebrew_package 'with_attributes' do
6
+ version '1.0.0'
7
+ action :purge
8
+ end
9
+
10
+ homebrew_package 'specifying the identity attribute' do
11
+ package_name 'identity_attribute'
12
+ action :purge
13
+ end
@@ -0,0 +1,13 @@
1
+ homebrew_package 'explicit_action' do
2
+ action :remove
3
+ end
4
+
5
+ homebrew_package 'with_attributes' do
6
+ version '1.0.0'
7
+ action :remove
8
+ end
9
+
10
+ homebrew_package 'specifying the identity attribute' do
11
+ package_name 'identity_attribute'
12
+ action :remove
13
+ end
@@ -0,0 +1,13 @@
1
+ homebrew_package 'explicit_action' do
2
+ action :upgrade
3
+ end
4
+
5
+ homebrew_package 'with_attributes' do
6
+ version '1.0.0'
7
+ action :upgrade
8
+ end
9
+
10
+ homebrew_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 'homebrew_package::install' do
4
+ let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
5
+
6
+ it 'installs a homebrew_package with the default action' do
7
+ expect(chef_run).to install_homebrew_package('default_action')
8
+ expect(chef_run).to_not install_homebrew_package('not_default_action')
9
+ end
10
+
11
+ it 'installs a homebrew_package with an explicit action' do
12
+ expect(chef_run).to install_homebrew_package('explicit_action')
13
+ end
14
+
15
+ it 'installs a homebrew_package with attributes' do
16
+ expect(chef_run).to install_homebrew_package('with_attributes').with(version: '1.0.0')
17
+ expect(chef_run).to_not install_homebrew_package('with_attributes').with(version: '1.2.3')
18
+ end
19
+
20
+ it 'installs a homebrew_package when specifying the identity attribute' do
21
+ expect(chef_run).to install_homebrew_package('identity_attribute')
22
+ end
23
+ end
@@ -0,0 +1,19 @@
1
+ require 'chefspec'
2
+
3
+ describe 'homebrew_package::purge' do
4
+ let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
5
+
6
+ it 'purges a homebrew_package with an explicit action' do
7
+ expect(chef_run).to purge_homebrew_package('explicit_action')
8
+ expect(chef_run).to_not purge_homebrew_package('not_explicit_action')
9
+ end
10
+
11
+ it 'purges a homebrew_package with attributes' do
12
+ expect(chef_run).to purge_homebrew_package('with_attributes').with(version: '1.0.0')
13
+ expect(chef_run).to_not purge_homebrew_package('with_attributes').with(version: '1.2.3')
14
+ end
15
+
16
+ it 'purges a homebrew_package when specifying the identity attribute' do
17
+ expect(chef_run).to purge_homebrew_package('identity_attribute')
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ require 'chefspec'
2
+
3
+ describe 'homebrew_package::remove' do
4
+ let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
5
+
6
+ it 'removes a homebrew_package with an explicit action' do
7
+ expect(chef_run).to remove_homebrew_package('explicit_action')
8
+ expect(chef_run).to_not remove_homebrew_package('not_explicit_action')
9
+ end
10
+
11
+ it 'removes a homebrew_package with attributes' do
12
+ expect(chef_run).to remove_homebrew_package('with_attributes').with(version: '1.0.0')
13
+ expect(chef_run).to_not remove_homebrew_package('with_attributes').with(version: '1.2.3')
14
+ end
15
+
16
+ it 'removes a homebrew_package when specifying the identity attribute' do
17
+ expect(chef_run).to remove_homebrew_package('identity_attribute')
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ require 'chefspec'
2
+
3
+ describe 'homebrew_package::upgrade' do
4
+ let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
5
+
6
+ it 'upgrades a homebrew_package with an explicit action' do
7
+ expect(chef_run).to upgrade_homebrew_package('explicit_action')
8
+ expect(chef_run).to_not upgrade_homebrew_package('not_explicit_action')
9
+ end
10
+
11
+ it 'upgrades a homebrew_package with attributes' do
12
+ expect(chef_run).to upgrade_homebrew_package('with_attributes').with(version: '1.0.0')
13
+ expect(chef_run).to_not upgrade_homebrew_package('with_attributes').with(version: '1.2.3')
14
+ end
15
+
16
+ it 'upgrades a homebrew_package when specifying the identity attribute' do
17
+ expect(chef_run).to upgrade_homebrew_package('identity_attribute')
18
+ end
19
+ end
@@ -0,0 +1,5 @@
1
+ launchd 'explicit_action' do
2
+ action :create
3
+ end
4
+
5
+ launchd 'default_action'
@@ -0,0 +1,3 @@
1
+ launchd 'explicit_action' do
2
+ action :create_if_missing
3
+ end
@@ -0,0 +1,3 @@
1
+ launchd 'explicit_action' do
2
+ action :delete
3
+ end
@@ -0,0 +1,3 @@
1
+ launchd 'explicit_action' do
2
+ action :disable
3
+ end
@@ -0,0 +1,3 @@
1
+ launchd 'explicit_action' do
2
+ action :enable
3
+ end
@@ -0,0 +1,10 @@
1
+ require 'chefspec'
2
+
3
+ describe 'launchd::create_if_missing' do
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.11.1').converge(described_recipe) }
5
+
6
+ it 'creates a launchd daemon if missing with an explicit action' do
7
+ expect(chef_run).to create_if_missing_launchd('explicit_action')
8
+ expect(chef_run).to_not create_if_missing_launchd('not_explicit_action')
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ require 'chefspec'
2
+
3
+ describe 'launchd::create' do
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.11.1').converge(described_recipe) }
5
+
6
+ it 'creates a launchd daemon with an explicit action' do
7
+ expect(chef_run).to create_launchd('explicit_action')
8
+ expect(chef_run).to_not create_launchd('not_explicit_action')
9
+ end
10
+
11
+ it 'creates a launchd daemon with a default_action action' do
12
+ expect(chef_run).to create_launchd('default_action')
13
+ end
14
+ end
@@ -0,0 +1,10 @@
1
+ require 'chefspec'
2
+
3
+ describe 'launchd::delete' do
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.11.1').converge(described_recipe) }
5
+
6
+ it 'deletes a launchd with an explicit action' do
7
+ expect(chef_run).to delete_launchd('explicit_action')
8
+ expect(chef_run).to_not delete_launchd('not_explicit_action')
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ require 'chefspec'
2
+
3
+ describe 'launchd::disable' do
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.11.1').converge(described_recipe) }
5
+
6
+ it 'disables a launchd daemon with an explicit action' do
7
+ expect(chef_run).to disable_launchd('explicit_action')
8
+ expect(chef_run).to_not disable_launchd('not_explicit_action')
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ require 'chefspec'
2
+
3
+ describe 'launchd::enable' do
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.11.1').converge(described_recipe) }
5
+
6
+ it 'enables a launchd daemon with an explicit action' do
7
+ expect(chef_run).to enable_launchd('explicit_action')
8
+ expect(chef_run).to_not enable_launchd('not_explicit_action')
9
+ end
10
+ end