chefspec 4.7.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -21
- data/CHANGELOG.md +18 -0
- data/Gemfile +1 -0
- data/README.md +37 -20
- data/chefspec.gemspec +4 -4
- data/examples/apt_repository/recipes/add.rb +8 -0
- data/examples/apt_repository/recipes/remove.rb +4 -0
- data/examples/apt_repository/spec/add_spec.rb +14 -0
- data/examples/apt_repository/spec/remove_spec.rb +9 -0
- data/examples/apt_update/recipes/periodic.rb +5 -0
- data/examples/apt_update/recipes/update.rb +3 -0
- data/examples/apt_update/spec/periodic_spec.rb +14 -0
- data/examples/apt_update/spec/update_spec.rb +9 -0
- data/examples/attributes/spec/default_spec.rb +1 -1
- data/examples/notifications/recipes/before.rb +7 -0
- data/examples/notifications/spec/before_spec.rb +16 -0
- data/examples/server/spec/node_spec.rb +3 -3
- data/examples/server/spec/search_spec.rb +4 -4
- data/examples/stub_node/spec/default_spec.rb +2 -2
- data/examples/subscribes/recipes/before.rb +5 -0
- data/examples/subscribes/spec/before_spec.rb +16 -0
- data/examples/user/spec/create_spec.rb +1 -1
- data/examples/user/spec/lock_spec.rb +1 -1
- data/examples/user/spec/manage_spec.rb +1 -1
- data/examples/user/spec/modify_spec.rb +1 -1
- data/examples/user/spec/remove_spec.rb +1 -1
- data/examples/user/spec/unlock_spec.rb +1 -1
- data/features/chocolatey_package.feature +0 -10
- data/features/dsc_resource.feature +0 -9
- data/features/notifications.feature +8 -0
- data/features/reboot.feature +0 -7
- data/features/step_into.feature +0 -7
- data/features/subscribes.feature +8 -0
- data/features/windows_package.feature +0 -9
- data/features/windows_service.feature +0 -7
- data/gemfiles/chefspec.gemfile +6 -0
- data/lib/chefspec/api/apt_repository.rb +56 -0
- data/lib/chefspec/api/apt_update.rb +53 -0
- data/lib/chefspec/cacher.rb +3 -2
- data/lib/chefspec/coverage.rb +38 -5
- data/lib/chefspec/errors.rb +3 -0
- data/lib/chefspec/extensions/chef/data_query.rb +2 -2
- data/lib/chefspec/matchers/notifications_matcher.rb +23 -2
- data/lib/chefspec/matchers/subscribes_matcher.rb +9 -0
- data/lib/chefspec/version.rb +1 -1
- data/spec/spec_helper.rb +5 -0
- data/spec/unit/cacher_spec.rb +17 -1
- data/spec/unit/matchers/notifications_matcher_spec.rb +1 -0
- data/spec/unit/matchers/subscribes_matcher_spec.rb +1 -0
- data/spec/unit/solo_runner_spec.rb +1 -1
- data/templates/coverage/json.erb +8 -0
- data/templates/coverage/table.erb +14 -0
- data/templates/errors/erb_template_parse_error.erb +5 -0
- data/templates/errors/template_not_found.erb +9 -0
- metadata +26 -11
- data/spec/unit/extensions/lwrp_base_spec.rb +0 -96
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2cb55b871d4f280113670d8ab781c00fd904bcf
|
4
|
+
data.tar.gz: ad23485af0935d3e69b4c3690c461f86edb416f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 624855a8994a04ebeaf46ef353aeed11b49693166a08d3b044ae80cbaff8a5656c5a25c33edca93b3f83ae7ea419c3a67c66ae661b5c2bb8d4a22833cd67f704
|
7
|
+
data.tar.gz: 28d33704f79f50c2cf0b96e3f498c696236f2449cae23e1917ec0a619e79d2d9bf775a0520eb857d24fca80e8b36a34ffe607e181da75c5070e3ef2915842cee
|
data/.travis.yml
CHANGED
@@ -6,8 +6,8 @@ before_install:
|
|
6
6
|
- gem install bundler
|
7
7
|
|
8
8
|
rvm:
|
9
|
-
- 2.1
|
10
|
-
- 2.2
|
9
|
+
- 2.1.9
|
10
|
+
- 2.2.5
|
11
11
|
|
12
12
|
branches:
|
13
13
|
only:
|
@@ -19,36 +19,22 @@ gemfile: gemfiles/chefspec.gemfile
|
|
19
19
|
|
20
20
|
env:
|
21
21
|
- CHEF_VERSION=master
|
22
|
+
- CHEF_VERSION=12.13.37
|
23
|
+
- CHEF_VERSION=12.12.15
|
24
|
+
- CHEF_VERSION=12.11.18
|
25
|
+
- CHEF_VERSION=12.10.24
|
26
|
+
- CHEF_VERSION=12.9.41
|
22
27
|
- CHEF_VERSION=12.8.1
|
23
28
|
- CHEF_VERSION=12.7.2
|
24
29
|
- CHEF_VERSION=12.6.0
|
25
30
|
- CHEF_VERSION=12.5.1
|
26
31
|
- CHEF_VERSION=12.4.3
|
27
|
-
- CHEF_VERSION=12.4.0
|
28
32
|
- CHEF_VERSION=12.3.0
|
29
33
|
- CHEF_VERSION=12.2.1
|
30
34
|
- CHEF_VERSION=12.1.2
|
31
|
-
- CHEF_VERSION=12.1.1
|
32
|
-
- CHEF_VERSION=12.1.0
|
33
35
|
- CHEF_VERSION=12.0.3
|
34
36
|
|
35
37
|
matrix:
|
36
38
|
fast_finish: true
|
37
39
|
allow_failures:
|
38
40
|
- env: CHEF_VERSION=master
|
39
|
-
include:
|
40
|
-
- env: CHEF_VERSION=11.18.6
|
41
|
-
rvm: 1.9.3
|
42
|
-
- env: CHEF_VERSION=11.18.0
|
43
|
-
rvm: 1.9.3
|
44
|
-
- env: CHEF_VERSION=11.16.4
|
45
|
-
rvm: 1.9.3
|
46
|
-
- env: CHEF_VERSION=11.16.2
|
47
|
-
rvm: 1.9.3
|
48
|
-
- env: CHEF_VERSION=11.16.0
|
49
|
-
rvm: 1.9.3
|
50
|
-
- env: CHEF_VERSION=11.14.6
|
51
|
-
rvm: 1.9.3
|
52
|
-
- env: CHEF_VERSION=11.14.2
|
53
|
-
rvm: 1.9.3
|
54
|
-
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# CHANGELOG for ChefSpec
|
2
2
|
|
3
|
+
## 5.0.0 (August 24, 2016)
|
4
|
+
|
5
|
+
IMPROVEMENTS
|
6
|
+
|
7
|
+
- Require a minimum of Chef 12.0
|
8
|
+
- Add custom templating to Coverage Reporting. See readme for details
|
9
|
+
- Add matcher for apt_repository resource
|
10
|
+
- Add matcher for apt_update resource
|
11
|
+
- Add support for the :before notification
|
12
|
+
- Allow stubbing encrypted databags loaded with data_bag_item
|
13
|
+
- Add testing against Chef 12.8 - 12.3
|
14
|
+
|
15
|
+
BUG FIXES
|
16
|
+
|
17
|
+
- Update docs/examples to use node.normal instead of node.set, which has been deprecated
|
18
|
+
- Update user spec examples to specify the platform
|
19
|
+
- Update docs to clarify the Ruby 2.1 requirement
|
20
|
+
|
3
21
|
## 4.7.0 (May 13, 2016)
|
4
22
|
|
5
23
|
IMPROVEMENTS
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -25,7 +25,7 @@ What people are saying
|
|
25
25
|
|
26
26
|
Important Notes
|
27
27
|
---------------
|
28
|
-
- **ChefSpec
|
28
|
+
- **ChefSpec requires Ruby 2.1 or later and Chef 12.0.2 or later!**
|
29
29
|
- **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!**
|
30
30
|
- **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).**
|
31
31
|
- **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.
|
@@ -35,8 +35,6 @@ Notes on Compatibility with Chef Versions
|
|
35
35
|
-----------------------------------------
|
36
36
|
As a general rule, if it is tested in the Travis CI matrix, it is a supported version. The section below details any specific versions that are _not_ supported and why:
|
37
37
|
|
38
|
-
- Chef 12 prior to Chef 12.0.2 is not supported due to the lack of a declared resource type. This was fixed in [Chef 12.0.2](https://github.com/chef/chef/blob/12.0.2/lib/chef/resource.rb#L422-428).
|
39
|
-
|
40
38
|
Additionally, if you look at a cucumber feature and see a tag like `@not_chef_x_y_z`, that means that particular functionality is not supported on those versions of Chef.
|
41
39
|
|
42
40
|
|
@@ -102,7 +100,7 @@ RSpec.configure do |config|
|
|
102
100
|
config.platform = 'ubuntu'
|
103
101
|
|
104
102
|
# Specify the operating version to mock Ohai data from (default: nil)
|
105
|
-
config.version = '
|
103
|
+
config.version = '14.04'
|
106
104
|
end
|
107
105
|
```
|
108
106
|
|
@@ -110,10 +108,10 @@ Values specified at the initialization of a "Runner" merge and take precedence o
|
|
110
108
|
|
111
109
|
```ruby
|
112
110
|
# Override only the operating system version (platform is still "ubuntu" from above)
|
113
|
-
ChefSpec::SoloRunner.new(version: '
|
111
|
+
ChefSpec::SoloRunner.new(version: '16.04')
|
114
112
|
|
115
113
|
# Use a different operating system platform and version
|
116
|
-
ChefSpec::SoloRunner.new(platform: 'centos', version: '
|
114
|
+
ChefSpec::SoloRunner.new(platform: 'centos', version: '7.2.1511')
|
117
115
|
|
118
116
|
# Specify a different cookbook_path
|
119
117
|
ChefSpec::SoloRunner.new(cookbook_path: '/var/my/other/path', role_path: '/var/my/roles')
|
@@ -128,7 +126,7 @@ ChefSpec::SoloRunner.new(file_cache_path: '/var/chef/cache')
|
|
128
126
|
ChefSpec::SoloRunner.new(log_level: :debug).converge(described_recipe)
|
129
127
|
```
|
130
128
|
|
131
|
-
**NOTE** You do not _need_ to specify a platform and version to use ChefSpec. However, some cookbooks may rely on [Ohai](http://github.com/
|
129
|
+
**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).
|
132
130
|
|
133
131
|
### Berkshelf
|
134
132
|
If you are using Berkshelf, simply require `chefspec/berkshelf` in your `spec_helper` after requiring `chefspec`:
|
@@ -342,7 +340,7 @@ You can use any RSpec content matcher inside of the `with_content` predicate:
|
|
342
340
|
expect(chef_run).to render_file('/etc/foo').with_content(start_with('# First line'))
|
343
341
|
```
|
344
342
|
|
345
|
-
It is possible to assert which [Chef phase of execution](
|
343
|
+
It is possible to assert which [Chef phase of execution](https://docs.chef.io/chef_client.html#the-chef-client-title-run) a resource is created. Given a resource that is installed at compile time using `run_action`:
|
346
344
|
|
347
345
|
```ruby
|
348
346
|
package('apache2').run_action(:install)
|
@@ -381,7 +379,7 @@ Node attribute can be set when creating the `Runner`. The initializer yields a b
|
|
381
379
|
describe 'example::default' do
|
382
380
|
let(:chef_run) do
|
383
381
|
ChefSpec::SoloRunner.new do |node|
|
384
|
-
node.
|
382
|
+
node.normal['cookbook']['attribute'] = 'hello'
|
385
383
|
end.converge(described_recipe)
|
386
384
|
end
|
387
385
|
end
|
@@ -400,7 +398,7 @@ describe 'example::default' do
|
|
400
398
|
end
|
401
399
|
```
|
402
400
|
|
403
|
-
The `node` that is returned is actually a [`Chef::Node`](
|
401
|
+
The `node` that is returned is actually a [`Chef::Node`](https://docs.chef.io/nodes.html) object.
|
404
402
|
|
405
403
|
To set an attribute within a specific test, set the attribute in the `it` block and then **(re-)converge the node**:
|
406
404
|
|
@@ -409,7 +407,7 @@ describe 'example::default' do
|
|
409
407
|
let(:chef_run) { ChefSpec::SoloRunner.new } # Notice we don't converge here
|
410
408
|
|
411
409
|
it 'performs the action' do
|
412
|
-
chef_run.node.
|
410
|
+
chef_run.node.normal['cookbook']['attribute'] = 'hello'
|
413
411
|
chef_run.converge(described_recipe) # The converge happens inside the test
|
414
412
|
|
415
413
|
expect(chef_run).to do_something
|
@@ -478,7 +476,7 @@ Note: the current "node" is always uploaded to the server. However, due to the w
|
|
478
476
|
|
479
477
|
```ruby
|
480
478
|
ChefSpec::ServerRunner.new do |node, server|
|
481
|
-
node.
|
479
|
+
node.normal['attribute'] = 'value'
|
482
480
|
|
483
481
|
# At this point, the server already has a copy of the current node object due
|
484
482
|
# to the way Chef compiled the resources. However, that node does not have
|
@@ -492,7 +490,7 @@ You may also use the `stub_node` macro, which will create a new `Chef::Node` obj
|
|
492
490
|
|
493
491
|
```ruby
|
494
492
|
www = stub_node(platform: 'ubuntu', version: '12.04') do |node|
|
495
|
-
node.
|
493
|
+
node.normal['attribute'] = 'value'
|
496
494
|
end
|
497
495
|
|
498
496
|
# `www` is now a local Chef::Node object you can use in your test. To publish
|
@@ -719,11 +717,11 @@ Untouched Resources:
|
|
719
717
|
package[git] bacon/recipes/default.rb:2
|
720
718
|
package[build-essential] bacon/recipes/default.rb:3
|
721
719
|
package[apache2] bacon/recipes/default.rb:4
|
722
|
-
package[
|
720
|
+
package[libvirt] bacon/recipes/default.rb:5
|
723
721
|
package[core] bacon/recipes/default.rb:6
|
724
722
|
```
|
725
723
|
|
726
|
-
By default, ChefSpec will test all cookbooks that are loaded as part of the Chef Client run. If you have a cookbook with many dependencies, this may be less than
|
724
|
+
By default, ChefSpec will test all cookbooks that are loaded as part of the Chef Client run. If you have a cookbook with many dependencies, this may be less than desirable. To restrict coverage reporting against certain cookbooks, `ChefSpec::Coverage` yields a block:
|
727
725
|
|
728
726
|
```ruby
|
729
727
|
ChefSpec::Coverage.start! do
|
@@ -781,6 +779,20 @@ ChefSpec::Coverage.start! do
|
|
781
779
|
end
|
782
780
|
```
|
783
781
|
|
782
|
+
If you would like a different output format for the Coverage.report! output, you can specify one of the three built-in templates, or supply your own by calling the set_template in the `ChefSpec::Coverage` block:
|
783
|
+
|
784
|
+
```ruby
|
785
|
+
ChefSpec::Coverage.start! do
|
786
|
+
set_template 'json.erb'
|
787
|
+
end
|
788
|
+
```
|
789
|
+
Provided templates are human.erb*(default)*, table.erb and json.erb, to supply a custom template, specify a relative(to run directory) or absolute path.
|
790
|
+
|
791
|
+
```ruby
|
792
|
+
ChefSpec::Coverage.start! do
|
793
|
+
set_template '/opt/custom/templates/verbose.erb'
|
794
|
+
end
|
795
|
+
```
|
784
796
|
|
785
797
|
Mocking Out Environments
|
786
798
|
------------------------
|
@@ -858,9 +870,10 @@ end
|
|
858
870
|
|
859
871
|
1. The entire contents of this file must be wrapped with the conditional clause checking if `ChefSpec` is defined.
|
860
872
|
2. Each matcher is actually a top-level method. The above example corresponds to the following RSpec test:
|
861
|
-
|
862
|
-
|
863
|
-
|
873
|
+
|
874
|
+
```ruby
|
875
|
+
expect(chef_run).to my_custom_matcher('...')
|
876
|
+
```
|
864
877
|
|
865
878
|
3. `ChefSpec::Matchers::ResourceMatcher` accepts three parameters:
|
866
879
|
1. The name of the resource to find in the resource collection (i.e. the name of the LWRP).
|
@@ -1148,11 +1161,15 @@ Development
|
|
1148
1161
|
1. Fork the repository from GitHub.
|
1149
1162
|
2. Clone your fork to your local machine:
|
1150
1163
|
|
1151
|
-
|
1164
|
+
```
|
1165
|
+
$ git clone git@github.com:USER/chefspec.git
|
1166
|
+
```
|
1152
1167
|
|
1153
1168
|
3. Create a git branch
|
1154
1169
|
|
1155
|
-
|
1170
|
+
```
|
1171
|
+
$ git checkout -b my_bug_fix
|
1172
|
+
```
|
1156
1173
|
|
1157
1174
|
4. **Write tests**
|
1158
1175
|
5. Make your changes/patches/fixes, committing appropriately
|
data/chefspec.gemspec
CHANGED
@@ -23,11 +23,11 @@ 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 1.
|
27
|
-
s.required_ruby_version = '>= 1
|
26
|
+
# ChefSpec requires Ruby 2.1+ since ChefDK uses 2.1.X
|
27
|
+
s.required_ruby_version = '>= 2.1'
|
28
28
|
|
29
|
-
s.add_dependency 'chef', '>=
|
30
|
-
s.add_dependency 'fauxhai', '~> 3.
|
29
|
+
s.add_dependency 'chef', '>= 12.0'
|
30
|
+
s.add_dependency 'fauxhai', '~> 3.6'
|
31
31
|
s.add_dependency 'rspec', '~> 3.0'
|
32
32
|
|
33
33
|
# Development Dependencies
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'chefspec'
|
2
|
+
|
3
|
+
describe 'apt_repository::add' do
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
5
|
+
|
6
|
+
it 'adds a apt_repository with default action' do
|
7
|
+
expect(chef_run).to add_apt_repository('default_action')
|
8
|
+
expect(chef_run).to_not add_apt_repository('not_default_action')
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'installs a apt_repository with an explicit action' do
|
12
|
+
expect(chef_run).to add_apt_repository('explicit_action')
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'chefspec'
|
2
|
+
|
3
|
+
describe 'apt_repository::remove' do
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
5
|
+
|
6
|
+
it 'removes a apt_repository with default action' do
|
7
|
+
expect(chef_run).to remove_apt_repository('explicit_remove_action')
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'chefspec'
|
2
|
+
|
3
|
+
describe 'apt_update::periodic' do
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
5
|
+
|
6
|
+
it 'updates apt with default action' do
|
7
|
+
expect(chef_run).to periodic_apt_update('default_action')
|
8
|
+
expect(chef_run).to_not periodic_apt_update('not_default_action')
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'installs a apt_repository with an explicit action' do
|
12
|
+
expect(chef_run).to periodic_apt_update('explicit_action')
|
13
|
+
end
|
14
|
+
end
|
@@ -4,7 +4,7 @@ describe 'attributes::default' do
|
|
4
4
|
let(:chef_run) do
|
5
5
|
ChefSpec::SoloRunner.new do |node|
|
6
6
|
node.automatic['ipaddress'] = '500.500.500.500' # Intentionally not a real IP
|
7
|
-
node.
|
7
|
+
node.normal['attributes']['message'] = 'The new message is here'
|
8
8
|
end.converge(described_recipe)
|
9
9
|
end
|
10
10
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'chefspec'
|
2
|
+
|
3
|
+
describe 'notifications::before' do
|
4
|
+
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
|
5
|
+
let(:template) { chef_run.template('/tmp/notifying_resource') }
|
6
|
+
|
7
|
+
it 'sends a notification to the service' do
|
8
|
+
expect(template).to notify('service[receiving_resource]').before
|
9
|
+
expect(template).to_not notify('service[not_receiving_resource]').before
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'sends the specific notification to the service before' do
|
13
|
+
expect(template).to notify('service[receiving_resource]').to(:restart).before
|
14
|
+
expect(template).to_not notify('service[receiving_resource]').to(:restart).immediately
|
15
|
+
end
|
16
|
+
end
|
@@ -18,7 +18,7 @@ describe 'server::node' do
|
|
18
18
|
|
19
19
|
context 'with custom Ohai data' do
|
20
20
|
let(:chef_run) do
|
21
|
-
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '
|
21
|
+
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '14.04')
|
22
22
|
.converge(described_recipe)
|
23
23
|
end
|
24
24
|
|
@@ -27,7 +27,7 @@ describe 'server::node' do
|
|
27
27
|
|
28
28
|
node = chef_run.get_node('chefspec')
|
29
29
|
expect(node['kernel']['name']).to eq('Linux')
|
30
|
-
expect(node['kernel']['release']).to eq('3.
|
30
|
+
expect(node['kernel']['release']).to eq('3.13.0-66-generic')
|
31
31
|
expect(node['kernel']['machine']).to eq('x86_64')
|
32
32
|
end
|
33
33
|
end
|
@@ -35,7 +35,7 @@ describe 'server::node' do
|
|
35
35
|
context 'with overridden node data' do
|
36
36
|
let(:chef_run) do
|
37
37
|
ChefSpec::ServerRunner.new do |node, server|
|
38
|
-
node.
|
38
|
+
node.normal['breakfast']['bacon'] = true
|
39
39
|
end.converge(described_recipe)
|
40
40
|
end
|
41
41
|
|
@@ -5,7 +5,7 @@ describe 'server::search' do
|
|
5
5
|
stub_node('node_1') do |node|
|
6
6
|
node.automatic['hostname'] = 'node_1'
|
7
7
|
node.automatic['fqdn'] = 'node_1.example.com'
|
8
|
-
node.
|
8
|
+
node.normal['bar'] = true
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
@@ -13,7 +13,7 @@ describe 'server::search' do
|
|
13
13
|
stub_node('node_2') do |node|
|
14
14
|
node.automatic['hostname'] = 'node_2'
|
15
15
|
node.automatic['fqdn'] = 'node_2.example.com'
|
16
|
-
node.
|
16
|
+
node.normal['bar'] = true
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -21,7 +21,7 @@ describe 'server::search' do
|
|
21
21
|
stub_node('node_3') do |node|
|
22
22
|
node.automatic['hostname'] = 'node_3'
|
23
23
|
node.automatic['fqdn'] = 'node_3.example.com'
|
24
|
-
node.
|
24
|
+
node.normal['bar'] = true
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -34,7 +34,7 @@ describe 'server::search' do
|
|
34
34
|
|
35
35
|
let(:chef_run) do
|
36
36
|
ChefSpec::ServerRunner.new do |node, server|
|
37
|
-
node.
|
37
|
+
node.normal['bar'] = true
|
38
38
|
server.update_node(node)
|
39
39
|
|
40
40
|
server.create_node(node_1)
|