chefspec 6.0.0 → 6.2.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 +14 -0
- data/README.md +23 -5
- data/chefspec.gemspec +1 -1
- data/examples/batch/recipes/run.rb +0 -4
- data/examples/batch/spec/run_spec.rb +0 -4
- data/examples/bff_package/spec/install_spec.rb +1 -1
- data/examples/bff_package/spec/purge_spec.rb +1 -1
- data/examples/bff_package/spec/remove_spec.rb +1 -1
- data/examples/bff_package/spec/upgrade_spec.rb +1 -1
- data/examples/freebsd_package/spec/install_spec.rb +1 -1
- data/examples/freebsd_package/spec/remove_spec.rb +1 -1
- data/examples/homebrew_package/spec/install_spec.rb +1 -1
- data/examples/homebrew_package/spec/purge_spec.rb +1 -1
- data/examples/homebrew_package/spec/remove_spec.rb +1 -1
- data/examples/homebrew_package/spec/upgrade_spec.rb +1 -1
- data/examples/launchd/spec/create_if_missing_spec.rb +1 -1
- data/examples/launchd/spec/create_spec.rb +1 -1
- data/examples/launchd/spec/delete_spec.rb +1 -1
- data/examples/launchd/spec/disable_spec.rb +1 -1
- data/examples/launchd/spec/enable_spec.rb +1 -1
- data/examples/macports_package/spec/install_spec.rb +1 -1
- data/examples/macports_package/spec/purge_spec.rb +1 -1
- data/examples/macports_package/spec/remove_spec.rb +1 -1
- data/examples/macports_package/spec/upgrade_spec.rb +1 -1
- data/examples/openbsd_package/spec/install_spec.rb +1 -1
- data/examples/openbsd_package/spec/purge_spec.rb +1 -1
- data/examples/openbsd_package/spec/remove_spec.rb +1 -1
- data/examples/openbsd_package/spec/upgrade_spec.rb +1 -1
- data/examples/osx_profile/spec/install_spec.rb +1 -1
- data/examples/osx_profile/spec/remove_spec.rb +1 -1
- data/examples/pacman_package/spec/install_spec.rb +1 -1
- data/examples/pacman_package/spec/purge_spec.rb +1 -1
- data/examples/pacman_package/spec/remove_spec.rb +1 -1
- data/examples/pacman_package/spec/upgrade_spec.rb +1 -1
- data/examples/paludis_package/spec/install_spec.rb +1 -1
- data/examples/paludis_package/spec/purge_spec.rb +1 -1
- data/examples/paludis_package/spec/remove_spec.rb +1 -1
- data/examples/paludis_package/spec/upgrade_spec.rb +1 -1
- data/examples/powershell_script/recipes/run.rb +0 -4
- data/examples/powershell_script/spec/run_spec.rb +0 -4
- data/examples/roles/spec/default_spec.rb +1 -1
- data/examples/rpm_package/spec/install_spec.rb +1 -1
- data/examples/rpm_package/spec/remove_spec.rb +1 -1
- data/examples/rpm_package/spec/upgrade_spec.rb +1 -1
- data/examples/ruby_block/spec/create_spec.rb +1 -1
- data/examples/ruby_block/spec/run_spec.rb +1 -1
- data/examples/script/recipes/run_bash.rb +0 -4
- data/examples/script/recipes/run_csh.rb +0 -4
- data/examples/script/recipes/run_ksh.rb +0 -4
- data/examples/script/recipes/run_perl.rb +0 -4
- data/examples/script/recipes/run_python.rb +0 -4
- data/examples/script/recipes/run_ruby.rb +0 -4
- data/examples/script/recipes/run_script.rb +0 -4
- data/examples/script/spec/run_bash_spec.rb +0 -4
- data/examples/script/spec/run_csh_spec.rb +0 -4
- data/examples/script/spec/run_ksh_spec.rb +1 -5
- data/examples/script/spec/run_perl_spec.rb +0 -4
- data/examples/script/spec/run_python_spec.rb +0 -4
- data/examples/script/spec/run_ruby_spec.rb +0 -4
- data/examples/script/spec/run_script_spec.rb +0 -4
- data/examples/server/spec/data_bag_spec.rb +8 -8
- data/examples/server/spec/exotic_port_spec.rb +17 -0
- data/examples/server/spec/node_spec.rb +1 -1
- data/examples/solaris_package/spec/upgrade_spec.rb +4 -1
- data/examples/stub_data_bag/spec/default_spec.rb +1 -1
- data/examples/stub_data_bag_item/spec/default_spec.rb +1 -1
- data/examples/stub_search/recipes/block.rb +3 -0
- data/examples/stub_search/recipes/default.rb +2 -5
- data/examples/stub_search/spec/block_spec.rb +27 -0
- data/examples/stub_search/spec/default_spec.rb +1 -1
- data/examples/yum_package/spec/install_spec.rb +1 -1
- data/examples/yum_package/spec/purge_spec.rb +1 -1
- data/examples/yum_package/spec/remove_spec.rb +1 -1
- data/examples/yum_package/spec/upgrade_spec.rb +1 -1
- data/examples/yum_repository/spec/add_spec.rb +1 -1
- data/examples/yum_repository/spec/create_spec.rb +1 -1
- data/examples/yum_repository/spec/delete_spec.rb +1 -1
- data/examples/yum_repository/spec/makecache_spec.rb +1 -1
- data/examples/yum_repository/spec/remove_spec.rb +1 -1
- data/examples/zypper_package/spec/install_spec.rb +1 -1
- data/examples/zypper_package/spec/purge_spec.rb +1 -1
- data/examples/zypper_package/spec/remove_spec.rb +1 -1
- data/examples/zypper_package/spec/upgrade_spec.rb +1 -1
- data/features/exotic_zero_port.feature +7 -0
- data/features/stub_search.feature +1 -1
- data/features/support/exotic_zero_port.rb +3 -0
- data/lib/chefspec/coverage.rb +25 -7
- data/lib/chefspec/extensions/chef/data_query.rb +6 -1
- data/lib/chefspec/macros.rb +1 -1
- data/lib/chefspec/rspec.rb +1 -0
- data/lib/chefspec/server_methods.rb +1 -1
- data/lib/chefspec/solo_runner.rb +2 -1
- data/lib/chefspec/version.rb +1 -1
- data/lib/chefspec/zero_server.rb +1 -0
- data/spec/unit/macros_spec.rb +2 -2
- data/spec/unit/solo_runner_spec.rb +3 -2
- metadata +18 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 11a70e63e41d70878f57327c5ed4008b49901a78
|
|
4
|
+
data.tar.gz: 7cfbd1b0ed9431a5c0ecba7d2445679863d61afd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 28874630542168cc116ab2a951a0254dc3eb7c23406c7dcffaf920a903948c09a32604d7c695254ee0065fc2ce3c345802cab5e78bb508206098069c490ab39d
|
|
7
|
+
data.tar.gz: 82d8a732f2d4a24b2c6350a0455a8d2bff1205d27f86ad65fed549f861460bf679152b650f6b50d5078eea42c3e40dc7b1d249193e9d6a9734d92f87cbbecc30
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# CHANGELOG for ChefSpec
|
|
2
2
|
|
|
3
|
+
## 6.2.0 (March 27, 2017)
|
|
4
|
+
|
|
5
|
+
- Correctly handle the block form of search() when using stubs
|
|
6
|
+
- Add support for alternative reporting output from Coverage.report!
|
|
7
|
+
|
|
8
|
+
## 6.1.0 (March 9, 2017)
|
|
9
|
+
|
|
10
|
+
- Loosen the Fauxhai dependency to allow Fauxhai 4.0 This deprecates a large number of Ohai mocks for end of life platforms. See <https://github.com/customink/fauxhai/blob/master/PLATFORMS.md> for the current list of platforms supported by Fauxhai
|
|
11
|
+
- SoloRunner defaults to use_policyfile == false now
|
|
12
|
+
|
|
13
|
+
## 6.0.1 (February 24, 2017)
|
|
14
|
+
|
|
15
|
+
- Add the ability to set the Chef Zero port range used by the ServerRunner
|
|
16
|
+
|
|
3
17
|
## 6.0.0 (February 22, 2017)
|
|
4
18
|
|
|
5
19
|
BREAKING CHANGES
|
data/README.md
CHANGED
|
@@ -19,7 +19,7 @@ ChefSpec runs your cookbook(s) locally with Chef Solo without actually convergin
|
|
|
19
19
|
|
|
20
20
|
## Important Notes
|
|
21
21
|
|
|
22
|
-
- **ChefSpec requires Ruby 2.
|
|
22
|
+
- **ChefSpec requires Ruby 2.2 or later and Chef 12.6 or later!**
|
|
23
23
|
- **This documentation corresponds to the master branch, which may be unreleased. Please check the README of the latest git tag or the gem's source for your version's documentation!**
|
|
24
24
|
- **Each resource matcher is self-documented using [Yard](http://rubydoc.info/github/sethvargo/chefspec) and has a corresponding aruba test from the [examples directory](https://github.com/sethvargo/chefspec/tree/master/examples).**
|
|
25
25
|
- **ChefSpec aims to maintain compatibility with the two most recent minor versions of Chef.** If you are running an older version of Chef it may work, or you will need to run an older version of ChefSpec.
|
|
@@ -58,7 +58,7 @@ Let's step through this file to see what is happening:
|
|
|
58
58
|
|
|
59
59
|
1. At the top of the spec file we require the chefspec gem. This is required so that our custom matchers are loaded. In larger projects, it is common practice to create a file named "spec_helper.rb" and include ChefSpec and perform other setup tasks in that file.
|
|
60
60
|
2. The `describe` keyword is part of RSpec and indicates that everything nested beneath is describing the `example::default` recipe. The convention is to have a separate spec for each recipe in your cookbook.
|
|
61
|
-
3. The `let` block on creates the `ChefSpec:
|
|
61
|
+
3. The `let` block on creates the `ChefSpec:SoloRunner` with mocked Ohai data for Ubuntu 16.04 from [Fauxhai](https://github.com/customink/fauxhai). It then does a fake Chef run with the run_list of `example::default`. Any subsequent examples can then refer to `chef_run` in order to make assertions about the resources that were created during the mock converge.
|
|
62
62
|
4. The `described_recipe` macro is a ChefSpec helper method that infers the recipe from the `describe` block. Alternatively you could specify the recipe directly.
|
|
63
63
|
5. The `it` block is an example specifying that the `foo` package is installed. Normally you will have multiple `it` blocks per recipe, each making a single assertion.
|
|
64
64
|
|
|
@@ -102,7 +102,7 @@ Values specified at the initialization of a "Runner" merge and take precedence o
|
|
|
102
102
|
ChefSpec::SoloRunner.new(version: '16.04')
|
|
103
103
|
|
|
104
104
|
# Use a different operating system platform and version
|
|
105
|
-
ChefSpec::SoloRunner.new(platform: 'centos', version: '7.
|
|
105
|
+
ChefSpec::SoloRunner.new(platform: 'centos', version: '7.3.1611')
|
|
106
106
|
|
|
107
107
|
# Specify a different cookbook_path
|
|
108
108
|
ChefSpec::SoloRunner.new(cookbook_path: '/var/my/other/path', role_path: '/var/my/roles')
|
|
@@ -117,7 +117,7 @@ ChefSpec::SoloRunner.new(file_cache_path: Chef::Config[:file_cache_path])
|
|
|
117
117
|
ChefSpec::SoloRunner.new(log_level: :debug).converge(described_recipe)
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
-
**NOTE** You do not _need_ to specify a platform and version to use ChefSpec. However, some cookbooks may rely on [Ohai](http://github.com/chef/ohai) data that ChefSpec cannot not automatically generate. Specifying the `platform` and `version` keys instructs ChefSpec to load stubbed Ohai attributes from another platform using [fauxhai](https://github.com/customink/fauxhai).
|
|
120
|
+
**NOTE** You do not _need_ to specify a platform and version to use ChefSpec. However, some cookbooks may rely on [Ohai](http://github.com/chef/ohai) data that ChefSpec cannot not automatically generate. Specifying the `platform` and `version` keys instructs ChefSpec to load stubbed Ohai attributes from another platform using [fauxhai](https://github.com/customink/fauxhai). See the [PLATFORMS.md file](https://github.com/customink/fauxhai/blob/master/PLATFORMS.md) in the Fauxhai repo for a complete list of platforms and versions for use with ChefSpec.
|
|
121
121
|
|
|
122
122
|
### ChefZero Server
|
|
123
123
|
|
|
@@ -503,7 +503,7 @@ end
|
|
|
503
503
|
You may also use the `stub_node` macro, which will create a new `Chef::Node` object and accepts the same parameters as the Chef Runner and a Fauxhai object:
|
|
504
504
|
|
|
505
505
|
```ruby
|
|
506
|
-
www = stub_node(platform: 'ubuntu', version: '
|
|
506
|
+
www = stub_node(platform: 'ubuntu', version: '16.04') do |node|
|
|
507
507
|
node.normal['attribute'] = 'value'
|
|
508
508
|
end
|
|
509
509
|
|
|
@@ -815,6 +815,24 @@ ChefSpec::Coverage.start! do
|
|
|
815
815
|
end
|
|
816
816
|
```
|
|
817
817
|
|
|
818
|
+
If you would like to add alternative reporting for the Coverage.report! ouput, you can supply your own by calling add_output in the `ChefSepc::Coverage` block:
|
|
819
|
+
Note the reportOutput has the following items in it: total, touched, coverage and collections of untouched_resources and all_resources
|
|
820
|
+
|
|
821
|
+
```ruby
|
|
822
|
+
ChefSpec::Coverage.start! do
|
|
823
|
+
add_output do |reportOutput|
|
|
824
|
+
File.open( "coverage.json","w" ) do |f|
|
|
825
|
+
f.puts(reportOutput[:total])
|
|
826
|
+
f.puts(reportOutput[:touched])
|
|
827
|
+
f.puts(reportOutput[:coverage])
|
|
828
|
+
f.puts(reportOutput[:untouched_resources])
|
|
829
|
+
f.puts(reportOutput[:all_resources])
|
|
830
|
+
end
|
|
831
|
+
end
|
|
832
|
+
end
|
|
833
|
+
```
|
|
834
|
+
Note the above example outputs the raw data without applying formatting.
|
|
835
|
+
|
|
818
836
|
## Mocking Out Environments
|
|
819
837
|
|
|
820
838
|
### ServerRunner
|
data/chefspec.gemspec
CHANGED
|
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
|
|
|
26
26
|
s.required_ruby_version = '>= 2.2'
|
|
27
27
|
|
|
28
28
|
s.add_dependency 'chef', '>= 12.0'
|
|
29
|
-
s.add_dependency 'fauxhai', '
|
|
29
|
+
s.add_dependency 'fauxhai', '>= 3.6', '< 5'
|
|
30
30
|
s.add_dependency 'rspec', '~> 3.0'
|
|
31
31
|
|
|
32
32
|
# Development Dependencies
|
|
@@ -19,8 +19,4 @@ describe 'batch::run' do
|
|
|
19
19
|
expect(chef_run).to run_batch('with_attributes').with(flags: '-f')
|
|
20
20
|
expect(chef_run).to_not run_batch('with_attributes').with(flags: '-x')
|
|
21
21
|
end
|
|
22
|
-
|
|
23
|
-
it 'runs a batch when specifying the identity attribute' do
|
|
24
|
-
expect(chef_run).to run_batch('identity_attribute')
|
|
25
|
-
end
|
|
26
22
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'bff_package::install' do
|
|
4
|
-
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'aix', version: '7.1').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'installs a bff_package with the default action' do
|
|
7
7
|
expect(chef_run).to install_bff_package('default_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'bff_package::purge' do
|
|
4
|
-
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'aix', version: '7.1').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'purges a bff_package with an explicit action' do
|
|
7
7
|
expect(chef_run).to purge_bff_package('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'bff_package::remove' do
|
|
4
|
-
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'aix', version: '7.1').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'removes a bff_package with an explicit action' do
|
|
7
7
|
expect(chef_run).to remove_bff_package('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'bff_package::upgrade' do
|
|
4
|
-
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'aix', version: '7.1').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'upgrades a bff_package with an explicit action' do
|
|
7
7
|
expect(chef_run).to upgrade_bff_package('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'homebrew_package::install' do
|
|
4
|
-
let(:chef_run) { ChefSpec::
|
|
4
|
+
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.12').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'installs a homebrew_package with the default action' do
|
|
7
7
|
expect(chef_run).to install_homebrew_package('default_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'homebrew_package::purge' do
|
|
4
|
-
let(:chef_run) { ChefSpec::
|
|
4
|
+
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.12').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'purges a homebrew_package with an explicit action' do
|
|
7
7
|
expect(chef_run).to purge_homebrew_package('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'homebrew_package::remove' do
|
|
4
|
-
let(:chef_run) { ChefSpec::
|
|
4
|
+
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.12').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'removes a homebrew_package with an explicit action' do
|
|
7
7
|
expect(chef_run).to remove_homebrew_package('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'homebrew_package::upgrade' do
|
|
4
|
-
let(:chef_run) { ChefSpec::
|
|
4
|
+
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.12').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'upgrades a homebrew_package with an explicit action' do
|
|
7
7
|
expect(chef_run).to upgrade_homebrew_package('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'launchd::create_if_missing' do
|
|
4
|
-
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.
|
|
4
|
+
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.12').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'creates a launchd daemon if missing with an explicit action' do
|
|
7
7
|
expect(chef_run).to create_if_missing_launchd('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'launchd::create' do
|
|
4
|
-
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.
|
|
4
|
+
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.12').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'creates a launchd daemon with an explicit action' do
|
|
7
7
|
expect(chef_run).to create_launchd('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'launchd::delete' do
|
|
4
|
-
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.
|
|
4
|
+
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.12').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'deletes a launchd with an explicit action' do
|
|
7
7
|
expect(chef_run).to delete_launchd('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'launchd::disable' do
|
|
4
|
-
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.
|
|
4
|
+
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.12').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'disables a launchd daemon with an explicit action' do
|
|
7
7
|
expect(chef_run).to disable_launchd('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'launchd::enable' do
|
|
4
|
-
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.
|
|
4
|
+
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.12').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'enables a launchd daemon with an explicit action' do
|
|
7
7
|
expect(chef_run).to enable_launchd('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'macports_package::install' do
|
|
4
|
-
let(:chef_run) { ChefSpec::ServerRunner.new(platform: '
|
|
4
|
+
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.12').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'installs a macports_package with the default action' do
|
|
7
7
|
expect(chef_run).to install_macports_package('default_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'macports_package::purge' do
|
|
4
|
-
let(:chef_run) { ChefSpec::ServerRunner.new(platform: '
|
|
4
|
+
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.12').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'purges a macports_package with an explicit action' do
|
|
7
7
|
expect(chef_run).to purge_macports_package('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'macports_package::remove' do
|
|
4
|
-
let(:chef_run) { ChefSpec::ServerRunner.new(platform: '
|
|
4
|
+
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.12').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'removes a macports_package with an explicit action' do
|
|
7
7
|
expect(chef_run).to remove_macports_package('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'macports_package::upgrade' do
|
|
4
|
-
let(:chef_run) { ChefSpec::ServerRunner.new(platform: '
|
|
4
|
+
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.12').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'upgrades a macports_package with an explicit action' do
|
|
7
7
|
expect(chef_run).to upgrade_macports_package('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'openbsd_package::install' do
|
|
4
|
-
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'openbsd', version: '5.4').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'installs a openbsd_package with the default action' do
|
|
7
7
|
expect(chef_run).to install_openbsd_package('default_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'openbsd_package::purge' do
|
|
4
|
-
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'openbsd', version: '5.4').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'purges a openbsd_package with an explicit action' do
|
|
7
7
|
expect(chef_run).to purge_openbsd_package('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'openbsd_package::remove' do
|
|
4
|
-
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'openbsd', version: '5.4').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'removes a openbsd_package with an explicit action' do
|
|
7
7
|
expect(chef_run).to remove_openbsd_package('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'openbsd_package::upgrade' do
|
|
4
|
-
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'openbsd', version: '5.4').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'upgrades a openbsd_package with an explicit action' do
|
|
7
7
|
expect(chef_run).to upgrade_openbsd_package('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'osx_profile::install' do
|
|
4
|
-
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.
|
|
4
|
+
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.12').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'installs an osx_profile with an explicit action' do
|
|
7
7
|
expect(chef_run).to install_osx_profile('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'osx_profile::remove' do
|
|
4
|
-
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.
|
|
4
|
+
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'mac_os_x', version: '10.12').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'removes an osx_profile from the resource name' do
|
|
7
7
|
expect(chef_run).to remove_osx_profile('specifying profile')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'paludis_package::install' do
|
|
4
|
-
let(:chef_run) { ChefSpec::SoloRunner.new(platform: '
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'gentoo', version: '2.2').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'installs a paludis_package with the default action' do
|
|
7
7
|
expect(chef_run).to install_paludis_package('default_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'paludis_package::purge' do
|
|
4
|
-
let(:chef_run) { ChefSpec::SoloRunner.new(platform: '
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'gentoo', version: '2.2').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'purges a paludis_package with an explicit action' do
|
|
7
7
|
expect(chef_run).to purge_paludis_package('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'paludis_package::remove' do
|
|
4
|
-
let(:chef_run) { ChefSpec::SoloRunner.new(platform: '
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'gentoo', version: '2.2').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'removes a paludis_package with an explicit action' do
|
|
7
7
|
expect(chef_run).to remove_paludis_package('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'paludis_package::upgrade' do
|
|
4
|
-
let(:chef_run) { ChefSpec::SoloRunner.new(platform: '
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'gentoo', version: '2.2').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'upgrades a paludis_package with an explicit action' do
|
|
7
7
|
expect(chef_run).to upgrade_paludis_package('explicit_action')
|
|
@@ -19,8 +19,4 @@ describe 'powershell_script::run' do
|
|
|
19
19
|
expect(chef_run).to run_powershell_script('with_attributes').with(flags: '--flags')
|
|
20
20
|
expect(chef_run).to_not run_powershell_script('with_attributes').with(flags: '--not-flags')
|
|
21
21
|
end
|
|
22
|
-
|
|
23
|
-
it 'runs a powershell_script when specifying the identity attribute' do
|
|
24
|
-
expect(chef_run).to run_powershell_script('identity_attribute')
|
|
25
|
-
end
|
|
26
22
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'roles' do
|
|
4
|
-
let(:chef_run) { ChefSpec::SoloRunner.converge('role[role]') }
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04').converge('role[role]') }
|
|
5
5
|
|
|
6
6
|
it 'expands the run_list' do
|
|
7
7
|
expect(chef_run).to include_recipe('roles::default')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'ruby_block::create' do
|
|
4
|
-
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'creates a ruby_block with an explicit action' do
|
|
7
7
|
expect(chef_run).to create_ruby_block('explicit_action')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'chefspec'
|
|
2
2
|
|
|
3
3
|
describe 'ruby_block::run' do
|
|
4
|
-
let(:chef_run) { ChefSpec::
|
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
|
|
5
5
|
|
|
6
6
|
it 'runs a ruby_block with the default action' do
|
|
7
7
|
expect(chef_run).to run_ruby_block('default_action')
|
|
@@ -16,8 +16,4 @@ describe 'script::run_bash' do
|
|
|
16
16
|
expect(chef_run).to run_bash('with_attributes').with(creates: 'creates')
|
|
17
17
|
expect(chef_run).to_not run_bash('with_attributes').with(creates: 'bacon')
|
|
18
18
|
end
|
|
19
|
-
|
|
20
|
-
it 'runs a bash script when specifying the identity attribute' do
|
|
21
|
-
expect(chef_run).to run_bash('identity_attribute')
|
|
22
|
-
end
|
|
23
19
|
end
|