chefspec 5.4.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +6 -2
  3. data/CHANGELOG.md +12 -1
  4. data/README.md +17 -3
  5. data/chefspec.gemspec +2 -3
  6. data/examples/apt_package/spec/install_spec.rb +1 -1
  7. data/examples/apt_package/spec/purge_spec.rb +1 -1
  8. data/examples/apt_package/spec/reconfig_spec.rb +1 -1
  9. data/examples/apt_package/spec/remove_spec.rb +1 -1
  10. data/examples/apt_package/spec/upgrade_spec.rb +1 -1
  11. data/examples/apt_repository/spec/add_spec.rb +1 -1
  12. data/examples/apt_repository/spec/remove_spec.rb +1 -1
  13. data/examples/apt_update/spec/periodic_spec.rb +1 -1
  14. data/examples/apt_update/spec/update_spec.rb +1 -1
  15. data/examples/batch/spec/run_spec.rb +1 -1
  16. data/examples/cab_package/recipes/install.rb +13 -0
  17. data/examples/cab_package/recipes/remove.rb +13 -0
  18. data/examples/cab_package/spec/install_spec.rb +26 -0
  19. data/examples/cab_package/spec/remove_spec.rb +22 -0
  20. data/examples/chocolatey_package/spec/install_spec.rb +1 -1
  21. data/examples/chocolatey_package/spec/remove_spec.rb +1 -1
  22. data/examples/chocolatey_package/spec/upgrade_spec.rb +1 -1
  23. data/examples/dnf_package/recipes/install.rb +13 -0
  24. data/examples/dnf_package/recipes/purge.rb +13 -0
  25. data/examples/dnf_package/recipes/remove.rb +13 -0
  26. data/examples/dnf_package/recipes/upgrade.rb +13 -0
  27. data/examples/dnf_package/spec/install_spec.rb +26 -0
  28. data/examples/dnf_package/spec/purge_spec.rb +22 -0
  29. data/examples/dnf_package/spec/remove_spec.rb +22 -0
  30. data/examples/dnf_package/spec/upgrade_spec.rb +22 -0
  31. data/examples/dpkg_package/spec/install_spec.rb +1 -1
  32. data/examples/dpkg_package/spec/purge_spec.rb +1 -1
  33. data/examples/dpkg_package/spec/remove_spec.rb +1 -1
  34. data/examples/dsc_resource/spec/run_spec.rb +4 -4
  35. data/examples/dsc_script/spec/run_spec.rb +1 -1
  36. data/examples/env/spec/create_spec.rb +1 -1
  37. data/examples/env/spec/delete_spec.rb +1 -1
  38. data/examples/env/spec/modify_spec.rb +1 -1
  39. data/examples/freebsd_package/spec/install_spec.rb +1 -1
  40. data/examples/freebsd_package/spec/remove_spec.rb +1 -1
  41. data/examples/ips_package/spec/install_spec.rb +1 -1
  42. data/examples/ips_package/spec/remove_spec.rb +1 -1
  43. data/examples/ips_package/spec/upgrade_spec.rb +1 -1
  44. data/examples/msu_package/recipes/install.rb +13 -0
  45. data/examples/msu_package/recipes/remove.rb +13 -0
  46. data/examples/msu_package/spec/install_spec.rb +26 -0
  47. data/examples/msu_package/spec/remove_spec.rb +22 -0
  48. data/examples/pacman_package/spec/install_spec.rb +1 -1
  49. data/examples/pacman_package/spec/purge_spec.rb +1 -1
  50. data/examples/pacman_package/spec/remove_spec.rb +1 -1
  51. data/examples/pacman_package/spec/upgrade_spec.rb +1 -1
  52. data/examples/portage_package/spec/install_spec.rb +1 -1
  53. data/examples/portage_package/spec/purge_spec.rb +1 -1
  54. data/examples/portage_package/spec/remove_spec.rb +1 -1
  55. data/examples/portage_package/spec/upgrade_spec.rb +1 -1
  56. data/examples/powershell_script/spec/run_spec.rb +1 -1
  57. data/examples/registry_key/spec/create_if_missing_spec.rb +1 -1
  58. data/examples/registry_key/spec/create_spec.rb +1 -1
  59. data/examples/registry_key/spec/delete_key_spec.rb +1 -1
  60. data/examples/registry_key/spec/delete_spec.rb +1 -1
  61. data/examples/roles/roles/role.rb +2 -2
  62. data/examples/rpm_package/spec/install_spec.rb +1 -1
  63. data/examples/rpm_package/spec/remove_spec.rb +1 -1
  64. data/examples/rpm_package/spec/upgrade_spec.rb +1 -1
  65. data/examples/server/spec/data_bag_spec.rb +9 -11
  66. data/examples/smartos_package/spec/install_spec.rb +1 -1
  67. data/examples/smartos_package/spec/remove_spec.rb +1 -1
  68. data/examples/smartos_package/spec/upgrade_spec.rb +1 -1
  69. data/examples/solaris_package/spec/install_spec.rb +1 -1
  70. data/examples/solaris_package/spec/remove_spec.rb +1 -1
  71. data/examples/step_into/spec/default_spec.rb +2 -2
  72. data/examples/use_inline_resources/spec/default_spec.rb +1 -1
  73. data/examples/windows_package/spec/install_spec.rb +1 -1
  74. data/examples/windows_package/spec/remove_spec.rb +1 -1
  75. data/examples/windows_service/spec/configure_startup_spec.rb +1 -1
  76. data/examples/windows_service/spec/disable_spec.rb +1 -1
  77. data/examples/windows_service/spec/enable_spec.rb +1 -1
  78. data/examples/windows_service/spec/reload_spec.rb +1 -1
  79. data/examples/windows_service/spec/restart_spec.rb +1 -1
  80. data/examples/windows_service/spec/start_spec.rb +1 -1
  81. data/examples/windows_service/spec/stop_spec.rb +1 -1
  82. data/examples/yum_package/spec/install_spec.rb +1 -1
  83. data/examples/yum_package/spec/purge_spec.rb +1 -1
  84. data/examples/yum_package/spec/remove_spec.rb +1 -1
  85. data/examples/yum_package/spec/upgrade_spec.rb +1 -1
  86. data/examples/yum_repository/spec/add_spec.rb +1 -1
  87. data/examples/yum_repository/spec/create_spec.rb +1 -1
  88. data/examples/yum_repository/spec/delete_spec.rb +1 -1
  89. data/examples/yum_repository/spec/makecache_spec.rb +1 -1
  90. data/examples/yum_repository/spec/remove_spec.rb +1 -1
  91. data/features/cab_package.feature +21 -0
  92. data/features/dnf_package.feature +26 -0
  93. data/features/msu_package.feature +23 -0
  94. data/features/support/env.rb +8 -0
  95. data/lib/chefspec.rb +0 -1
  96. data/lib/chefspec/api.rb +3 -0
  97. data/lib/chefspec/api/cab_package.rb +80 -0
  98. data/lib/chefspec/api/dnf_package.rb +154 -0
  99. data/lib/chefspec/api/msu_package.rb +81 -0
  100. data/lib/chefspec/rspec.rb +1 -0
  101. data/lib/chefspec/server_methods.rb +4 -35
  102. data/lib/chefspec/server_runner.rb +2 -42
  103. data/lib/chefspec/version.rb +1 -1
  104. data/lib/chefspec/zero_server.rb +139 -0
  105. metadata +31 -6
  106. data/lib/chefspec/chef_backwards_compat.rb +0 -79
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'smartos_package::install' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'smartos', version: '5.11')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'installs a smartos_package with the default action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'smartos_package::remove' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'smartos', version: '5.11')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'removes a smartos_package with an explicit action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'smartos_package::upgrade' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'smartos', version: '5.11')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'upgrades a smartos_package with an explicit action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'solaris_package::install' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'solaris2', version: '5.11')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'installs a solaris_package with the default action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'solaris_package::remove' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'solaris2', version: '5.11')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'removes a solaris_package with an explicit action' do
@@ -15,8 +15,8 @@ describe 'step_into::default' do
15
15
 
16
16
  context 'with :step_into' do
17
17
  let(:chef_run) do
18
- ChefSpec::ServerRunner.new(step_into: %w(step_into_lwrp provides_this))
19
- .converge(described_recipe)
18
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04', step_into: %w(step_into_lwrp provides_this))
19
+ .converge(described_recipe)
20
20
  end
21
21
 
22
22
  it 'executes the LWRPs action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'use_inline_resources::default' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04', step_into: ['use_inline_resources_lwrp'])
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'uses the LWRP' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'windows_package::install' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'windows', version: '2012R2')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'installs a windows_package with an explicit action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'windows_package::remove' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'windows', version: '2012R2')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'removes a windows_package with an explicit action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'windows_service::configure_startup' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'windows', version: '2012R2')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'configures startup for a windows_service with an explicit action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'windows_service::disable' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'windows', version: '2012R2')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'disables a windows_service with an explicit action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'windows_service::enable' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'windows', version: '2012R2')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'enables a windows_service with an explicit action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'windows_service::reload' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'windows', version: '2012R2')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'reloads a windows_service with an explicit action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'windows_service::restart' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'windows', version: '2012R2')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'restarts a windows_service with an explicit action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'windows_service::start' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'windows', version: '2012R2')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'starts a windows_service with an explicit action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'windows_service::stop' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'windows', version: '2012R2')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'stops a windows_service with an explicit action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'yum_package::install' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'centos', version: '7.2.1511')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'installs a yum_package with the default action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'yum_package::purge' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'centos', version: '7.2.1511')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'purges a yum_package with an explicit action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'yum_package::remove' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'centos', version: '7.2.1511')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'removes a yum_package with an explicit action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'yum_package::upgrade' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'centos', version: '7.2.1511')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'upgrades a yum_package with an explicit action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'yum_repository::add' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'centos', version: '7.2.1511')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'creates a yum_repository with add action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'yum_repository::create' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'centos', version: '7.2.1511')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'create a yum_repository with default action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'yum_repository::delete' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'centos', version: '7.2.1511')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'removes a yum_repository with delete action' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'yum_repository::makecache' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'centos', version: '7.2.1511')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'makes cache for a yum_repository' do
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  describe 'yum_repository::remove' do
4
4
  let(:chef_run) do
5
5
  ChefSpec::ServerRunner.new(platform: 'centos', version: '7.2.1511')
6
- .converge(described_recipe)
6
+ .converge(described_recipe)
7
7
  end
8
8
 
9
9
  it 'removes a yum_repository with remove action' do
@@ -0,0 +1,21 @@
1
+ @not_chef_12_6_0
2
+ @not_chef_12_7_2
3
+ @not_chef_12_8_1
4
+ @not_chef_12_9_41
5
+ @not_chef_12_10_24
6
+ @not_chef_12_11_18
7
+ @not_chef_12_12_15
8
+ @not_chef_12_13_37
9
+ @not_chef_12_14_89
10
+
11
+ Feature: The cab_package matcher
12
+ Background:
13
+ * I am using the "cab_package" cookbook
14
+
15
+ Scenario Outline: Running specs
16
+ * I successfully run `rspec spec/<Matcher>_spec.rb`
17
+ * the output should contain "0 failures"
18
+ Examples:
19
+ | Matcher |
20
+ | install |
21
+ | remove |
@@ -0,0 +1,26 @@
1
+ @not_chef_12_6_0
2
+ @not_chef_12_7_2
3
+ @not_chef_12_8_1
4
+ @not_chef_12_9_41
5
+ @not_chef_12_10_24
6
+ @not_chef_12_11_18
7
+ @not_chef_12_12_15
8
+ @not_chef_12_13_37
9
+ @not_chef_12_14_89
10
+ @not_chef_12_15_19
11
+ @not_chef_12_16_42
12
+ @not_chef_12_17_44
13
+
14
+ Feature: The dnf_package matcher
15
+ Background:
16
+ * I am using the "dnf_package" cookbook
17
+
18
+ Scenario Outline: Running specs
19
+ * I successfully run `rspec spec/<Matcher>_spec.rb`
20
+ * the output should contain "0 failures"
21
+ Examples:
22
+ | Matcher |
23
+ | install |
24
+ | purge |
25
+ | remove |
26
+ | upgrade |
@@ -0,0 +1,23 @@
1
+ @not_chef_12_6_0
2
+ @not_chef_12_7_2
3
+ @not_chef_12_8_1
4
+ @not_chef_12_9_41
5
+ @not_chef_12_10_24
6
+ @not_chef_12_11_18
7
+ @not_chef_12_12_15
8
+ @not_chef_12_13_37
9
+ @not_chef_12_14_89
10
+ @not_chef_12_15_19
11
+ @not_chef_12_16_42
12
+
13
+ Feature: The msu_package matcher
14
+ Background:
15
+ * I am using the "msu_package" cookbook
16
+
17
+ Scenario Outline: Running specs
18
+ * I successfully run `rspec spec/<Matcher>_spec.rb`
19
+ * the output should contain "0 failures"
20
+ Examples:
21
+ | Matcher |
22
+ | install |
23
+ | remove |
@@ -20,6 +20,14 @@ Before do
20
20
  # RSpec::Runner) removes our configurations :(
21
21
  load 'lib/chefspec/rspec.rb'
22
22
 
23
+ # These settings need to be specified manually here rather than in rspec.rb
24
+ # because we do not want the zero-server terminating between each run. The
25
+ # runs happen too quickly in succession the port doesn't have time to get reset.
26
+ RSpec.configure do |config|
27
+ config.before(:suite) { ChefSpec::ZeroServer.setup! }
28
+ config.after(:each) { ChefSpec::ZeroServer.reset! }
29
+ end
30
+
23
31
  # Use a temporary directory to suppress Travis warnings
24
32
  @dirs = [Dir.mktmpdir]
25
33
  end
data/lib/chefspec.rb CHANGED
@@ -80,4 +80,3 @@ require_relative 'chefspec/util'
80
80
  require_relative 'chefspec/version'
81
81
 
82
82
  require_relative 'chefspec/deprecations'
83
- require_relative 'chefspec/chef_backwards_compat' if Chef::VERSION.to_f < 12.0
data/lib/chefspec/api.rb CHANGED
@@ -29,12 +29,14 @@ require_relative 'api/apt_update'
29
29
  require_relative 'api/apt_repository'
30
30
  require_relative 'api/bff_package'
31
31
  require_relative 'api/batch'
32
+ require_relative 'api/cab_package'
32
33
  require_relative 'api/chef_gem'
33
34
  require_relative 'api/chocolatey_package'
34
35
  require_relative 'api/cookbook_file'
35
36
  require_relative 'api/cron'
36
37
  require_relative 'api/deploy'
37
38
  require_relative 'api/directory'
39
+ require_relative 'api/dnf_package'
38
40
  require_relative 'api/dpkg_package'
39
41
  require_relative 'api/do_nothing'
40
42
  require_relative 'api/dsc_resource'
@@ -59,6 +61,7 @@ require_relative 'api/log'
59
61
  require_relative 'api/macports_package'
60
62
  require_relative 'api/mdadm'
61
63
  require_relative 'api/mount'
64
+ require_relative 'api/msu_package'
62
65
  require_relative 'api/notifications'
63
66
  require_relative 'api/ohai'
64
67
  require_relative 'api/openbsd_package'
@@ -0,0 +1,80 @@
1
+ module ChefSpec::API
2
+ # @since 6.0.0
3
+ module CabPackageMatchers
4
+ ChefSpec.define_matcher :cab_package
5
+
6
+ #
7
+ # Assert that a +cab_package+ resource exists in the Chef run with the
8
+ # action +:install+. Given a Chef Recipe that installs "apache2" as a
9
+ # +cab_package+:
10
+ #
11
+ # cab_package 'apache2' do
12
+ # action :install
13
+ # end
14
+ #
15
+ # The Examples section demonstrates the different ways to test a
16
+ # +cab_package+ resource with ChefSpec.
17
+ #
18
+ # @example Assert that a +cab_package+ was installed
19
+ # expect(chef_run).to install_cab_package('apache2')
20
+ #
21
+ # @example Assert that a +cab_package+ was installed with predicate matchers
22
+ # expect(chef_run).to install_cab_package('apache2').with_version('1.2.3')
23
+ #
24
+ # @example Assert that a +cab_package+ was installed with attributes
25
+ # expect(chef_run).to install_cab_package('apache2').with(version: '1.2.3')
26
+ #
27
+ # @example Assert that a +cab_package+ was installed using a regex
28
+ # expect(chef_run).to install_cab_package('apache2').with(version: /(\d+\.){2}\.\d+/)
29
+ #
30
+ # @example Assert that a +cab_package+ was _not_ installed
31
+ # expect(chef_run).to_not install_cab_package('apache2')
32
+ #
33
+ #
34
+ # @param [String, Regex] resource_name
35
+ # the name of the resource to match
36
+ #
37
+ # @return [ChefSpec::Matchers::ResourceMatcher]
38
+ #
39
+ def install_cab_package(resource_name)
40
+ ChefSpec::Matchers::ResourceMatcher.new(:cab_package, :install, resource_name)
41
+ end
42
+
43
+ #
44
+ # Assert that a +cab_package+ resource exists in the Chef run with the
45
+ # action +:remove+. Given a Chef Recipe that removes "apache2" as a
46
+ # +cab_package+:
47
+ #
48
+ # cab_package 'apache2' do
49
+ # action :remove
50
+ # end
51
+ #
52
+ # The Examples section demonstrates the different ways to test a
53
+ # +cab_package+ resource with ChefSpec.
54
+ #
55
+ # @example Assert that a +cab_package+ was removed
56
+ # expect(chef_run).to remove_cab_package('apache2')
57
+ #
58
+ # @example Assert that a +cab_package+ was removed with predicate matchers
59
+ # expect(chef_run).to remove_cab_package('apache2').with_version('1.2.3')
60
+ #
61
+ # @example Assert that a +cab_package+ was removed with attributes
62
+ # expect(chef_run).to remove_cab_package('apache2').with(version: '1.2.3')
63
+ #
64
+ # @example Assert that a +cab_package+ was removed using a regex
65
+ # expect(chef_run).to remove_cab_package('apache2').with(version: /(\d+\.){2}\.\d+/)
66
+ #
67
+ # @example Assert that a +cab_package+ was _not_ removed
68
+ # expect(chef_run).to_not remove_cab_package('apache2')
69
+ #
70
+ #
71
+ # @param [String, Regex] resource_name
72
+ # the name of the resource to match
73
+ #
74
+ # @return [ChefSpec::Matchers::ResourceMatcher]
75
+ #
76
+ def remove_cab_package(resource_name)
77
+ ChefSpec::Matchers::ResourceMatcher.new(:cab_package, :remove, resource_name)
78
+ end
79
+ end
80
+ end