chefspec-chef 9.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +30 -0
- data/LICENSE +22 -0
- data/Rakefile +85 -0
- data/chefspec-chef.gemspec +30 -0
- data/lib/chefspec/api/core.rb +217 -0
- data/lib/chefspec/api/described.rb +53 -0
- data/lib/chefspec/api/do_nothing.rb +26 -0
- data/lib/chefspec/api/include_any_recipe.rb +24 -0
- data/lib/chefspec/api/include_recipe.rb +28 -0
- data/lib/chefspec/api/link.rb +28 -0
- data/lib/chefspec/api/notifications.rb +40 -0
- data/lib/chefspec/api/reboot.rb +14 -0
- data/lib/chefspec/api/render_file.rb +37 -0
- data/lib/chefspec/api/state_attrs.rb +30 -0
- data/lib/chefspec/api/stubs.rb +183 -0
- data/lib/chefspec/api/stubs_for.rb +139 -0
- data/lib/chefspec/api/subscriptions.rb +37 -0
- data/lib/chefspec/api/user.rb +230 -0
- data/lib/chefspec/api.rb +39 -0
- data/lib/chefspec/berkshelf.rb +63 -0
- data/lib/chefspec/cacher.rb +64 -0
- data/lib/chefspec/coverage/filters.rb +82 -0
- data/lib/chefspec/coverage.rb +247 -0
- data/lib/chefspec/deprecations.rb +46 -0
- data/lib/chefspec/errors.rb +48 -0
- data/lib/chefspec/expect_exception.rb +51 -0
- data/lib/chefspec/extensions/chef/client.rb +21 -0
- data/lib/chefspec/extensions/chef/conditional.rb +16 -0
- data/lib/chefspec/extensions/chef/cookbook/gem_installer.rb +33 -0
- data/lib/chefspec/extensions/chef/cookbook_loader.rb +14 -0
- data/lib/chefspec/extensions/chef/cookbook_uploader.rb +12 -0
- data/lib/chefspec/extensions/chef/data_query.rb +49 -0
- data/lib/chefspec/extensions/chef/lwrp_base.rb +29 -0
- data/lib/chefspec/extensions/chef/provider.rb +39 -0
- data/lib/chefspec/extensions/chef/resource/freebsd_package.rb +17 -0
- data/lib/chefspec/extensions/chef/resource.rb +188 -0
- data/lib/chefspec/extensions/chef/run_context/cookbook_compiler.rb +84 -0
- data/lib/chefspec/extensions/chef/securable.rb +19 -0
- data/lib/chefspec/extensions/ohai/system.rb +11 -0
- data/lib/chefspec/extensions.rb +21 -0
- data/lib/chefspec/file_cache_path_proxy.rb +15 -0
- data/lib/chefspec/formatter.rb +282 -0
- data/lib/chefspec/librarian.rb +51 -0
- data/lib/chefspec/matchers/do_nothing_matcher.rb +52 -0
- data/lib/chefspec/matchers/include_any_recipe_matcher.rb +51 -0
- data/lib/chefspec/matchers/include_recipe_matcher.rb +46 -0
- data/lib/chefspec/matchers/link_to_matcher.rb +37 -0
- data/lib/chefspec/matchers/notifications_matcher.rb +143 -0
- data/lib/chefspec/matchers/render_file_matcher.rb +140 -0
- data/lib/chefspec/matchers/resource_matcher.rb +175 -0
- data/lib/chefspec/matchers/state_attrs_matcher.rb +71 -0
- data/lib/chefspec/matchers/subscribes_matcher.rb +72 -0
- data/lib/chefspec/matchers.rb +13 -0
- data/lib/chefspec/mixins/normalize.rb +22 -0
- data/lib/chefspec/policyfile.rb +69 -0
- data/lib/chefspec/renderer.rb +145 -0
- data/lib/chefspec/rspec.rb +21 -0
- data/lib/chefspec/runner.rb +8 -0
- data/lib/chefspec/server.rb +4 -0
- data/lib/chefspec/server_methods.rb +173 -0
- data/lib/chefspec/server_runner.rb +76 -0
- data/lib/chefspec/solo_runner.rb +516 -0
- data/lib/chefspec/stubs/command_registry.rb +11 -0
- data/lib/chefspec/stubs/command_stub.rb +37 -0
- data/lib/chefspec/stubs/data_bag_item_registry.rb +13 -0
- data/lib/chefspec/stubs/data_bag_item_stub.rb +25 -0
- data/lib/chefspec/stubs/data_bag_registry.rb +13 -0
- data/lib/chefspec/stubs/data_bag_stub.rb +23 -0
- data/lib/chefspec/stubs/registry.rb +32 -0
- data/lib/chefspec/stubs/search_registry.rb +13 -0
- data/lib/chefspec/stubs/search_stub.rb +25 -0
- data/lib/chefspec/stubs/stub.rb +38 -0
- data/lib/chefspec/util.rb +58 -0
- data/lib/chefspec/version.rb +3 -0
- data/lib/chefspec/zero_server.rb +142 -0
- data/lib/chefspec.rb +75 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/support/hash.rb +35 -0
- data/spec/unit/cacher_spec.rb +70 -0
- data/spec/unit/coverage/filters_spec.rb +60 -0
- data/spec/unit/deprecations_spec.rb +52 -0
- data/spec/unit/errors_spec.rb +57 -0
- data/spec/unit/expect_exception_spec.rb +32 -0
- data/spec/unit/macros_spec.rb +119 -0
- data/spec/unit/matchers/do_nothing_matcher.rb +5 -0
- data/spec/unit/matchers/include_any_recipe_matcher_spec.rb +52 -0
- data/spec/unit/matchers/include_recipe_matcher_spec.rb +38 -0
- data/spec/unit/matchers/link_to_matcher_spec.rb +55 -0
- data/spec/unit/matchers/notifications_matcher_spec.rb +39 -0
- data/spec/unit/matchers/render_file_matcher_spec.rb +68 -0
- data/spec/unit/matchers/resource_matcher_spec.rb +5 -0
- data/spec/unit/matchers/state_attrs_matcher_spec.rb +68 -0
- data/spec/unit/matchers/subscribes_matcher_spec.rb +63 -0
- data/spec/unit/renderer_spec.rb +69 -0
- data/spec/unit/server_runner_spec.rb +28 -0
- data/spec/unit/solo_runner_spec.rb +171 -0
- data/spec/unit/stubs/command_registry_spec.rb +27 -0
- data/spec/unit/stubs/command_stub_spec.rb +61 -0
- data/spec/unit/stubs/data_bag_item_registry_spec.rb +39 -0
- data/spec/unit/stubs/data_bag_item_stub_spec.rb +36 -0
- data/spec/unit/stubs/data_bag_registry_spec.rb +39 -0
- data/spec/unit/stubs/data_bag_stub_spec.rb +35 -0
- data/spec/unit/stubs/registry_spec.rb +29 -0
- data/spec/unit/stubs/search_registry_spec.rb +39 -0
- data/spec/unit/stubs/search_stub_spec.rb +36 -0
- data/spec/unit/stubs/stub_spec.rb +64 -0
- data/templates/coverage/human.erb +22 -0
- data/templates/coverage/json.erb +8 -0
- data/templates/coverage/table.erb +14 -0
- data/templates/errors/cookbook_path_not_found.erb +3 -0
- data/templates/errors/erb_template_parse_error.erb +5 -0
- data/templates/errors/gem_load_error.erb +7 -0
- data/templates/errors/invalid_berkshelf_options.erb +4 -0
- data/templates/errors/may_need_to_specify_platform.erb +25 -0
- data/templates/errors/no_conversion_error.erb +1 -0
- data/templates/errors/not_stubbed.erb +7 -0
- data/templates/errors/shell_out_not_stubbed.erb +10 -0
- data/templates/errors/template_not_found.erb +9 -0
- metadata +221 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
It appears that Chef could not find the resource on the given platform. As of
|
2
|
+
Chef 12.4, Chef conditionally loads resources based on the operating system
|
3
|
+
being provisioned. Double-check the error below and ensure you did not make any
|
4
|
+
typographical errors, and then continue reading.
|
5
|
+
|
6
|
+
The default operating system for ChefSpec is "chefspec", which means Chef will
|
7
|
+
not load many resources by default. For example, "dpkg_package" is not a
|
8
|
+
resource that is available on the "chefspec" operating system just like
|
9
|
+
"freebsd_package" is not available on the Windows operating system. As such,
|
10
|
+
you may get a Chef::Exceptions::NoSuchResourceType when using ChefSpec's default
|
11
|
+
options.
|
12
|
+
|
13
|
+
You can specify the platform and version you would like ChefSpec to act like
|
14
|
+
by specifying the platform and version like so:
|
15
|
+
|
16
|
+
ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '18.04')
|
17
|
+
|
18
|
+
You can read more information in ChefSpec's README or the Fauxhai project:
|
19
|
+
|
20
|
+
https://github.com/chefspec/chefspec#configuration
|
21
|
+
https://github.com/chefspec/fauxhai
|
22
|
+
|
23
|
+
Here is the original error:
|
24
|
+
|
25
|
+
<%= @original_error %>
|
@@ -0,0 +1 @@
|
|
1
|
+
You called a deprecated method without a backwards compatible replacement.
|
@@ -0,0 +1,10 @@
|
|
1
|
+
Executing a real shell_out in <%= @resource %> is not allowed:
|
2
|
+
|
3
|
+
shell_out(<%= @args.inspect[1..-2] %>)
|
4
|
+
|
5
|
+
You can stub this with:
|
6
|
+
|
7
|
+
stubs_for_<%= @type %>(<%= @resource.to_s.inspect %>) do |<%= @type %>|
|
8
|
+
allow(<%= @type %>).to receive_shell_out(<%= @args.inspect[1..-2] %>)
|
9
|
+
end
|
10
|
+
|
metadata
ADDED
@@ -0,0 +1,221 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: chefspec-chef
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 9.3.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andrew Crump
|
8
|
+
- Seth Vargo
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2022-06-14 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: chef
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '15'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '15'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: chef-cli
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: fauxhai-chef
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '9.3'
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '9.3'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rspec
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '3.0'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '3.0'
|
70
|
+
description: ChefSpec is a unit testing and resource coverage (code coverage) framework
|
71
|
+
for testing Chef cookbooks ChefSpec makes it easy to write examples and get fast
|
72
|
+
feedback on cookbook changes without the need for virtual machines or cloud servers.
|
73
|
+
email:
|
74
|
+
- andrew.crump@ieee.org
|
75
|
+
- sethvargo@gmail.com
|
76
|
+
executables: []
|
77
|
+
extensions: []
|
78
|
+
extra_rdoc_files: []
|
79
|
+
files:
|
80
|
+
- Gemfile
|
81
|
+
- LICENSE
|
82
|
+
- Rakefile
|
83
|
+
- chefspec-chef.gemspec
|
84
|
+
- lib/chefspec.rb
|
85
|
+
- lib/chefspec/api.rb
|
86
|
+
- lib/chefspec/api/core.rb
|
87
|
+
- lib/chefspec/api/described.rb
|
88
|
+
- lib/chefspec/api/do_nothing.rb
|
89
|
+
- lib/chefspec/api/include_any_recipe.rb
|
90
|
+
- lib/chefspec/api/include_recipe.rb
|
91
|
+
- lib/chefspec/api/link.rb
|
92
|
+
- lib/chefspec/api/notifications.rb
|
93
|
+
- lib/chefspec/api/reboot.rb
|
94
|
+
- lib/chefspec/api/render_file.rb
|
95
|
+
- lib/chefspec/api/state_attrs.rb
|
96
|
+
- lib/chefspec/api/stubs.rb
|
97
|
+
- lib/chefspec/api/stubs_for.rb
|
98
|
+
- lib/chefspec/api/subscriptions.rb
|
99
|
+
- lib/chefspec/api/user.rb
|
100
|
+
- lib/chefspec/berkshelf.rb
|
101
|
+
- lib/chefspec/cacher.rb
|
102
|
+
- lib/chefspec/coverage.rb
|
103
|
+
- lib/chefspec/coverage/filters.rb
|
104
|
+
- lib/chefspec/deprecations.rb
|
105
|
+
- lib/chefspec/errors.rb
|
106
|
+
- lib/chefspec/expect_exception.rb
|
107
|
+
- lib/chefspec/extensions.rb
|
108
|
+
- lib/chefspec/extensions/chef/client.rb
|
109
|
+
- lib/chefspec/extensions/chef/conditional.rb
|
110
|
+
- lib/chefspec/extensions/chef/cookbook/gem_installer.rb
|
111
|
+
- lib/chefspec/extensions/chef/cookbook_loader.rb
|
112
|
+
- lib/chefspec/extensions/chef/cookbook_uploader.rb
|
113
|
+
- lib/chefspec/extensions/chef/data_query.rb
|
114
|
+
- lib/chefspec/extensions/chef/lwrp_base.rb
|
115
|
+
- lib/chefspec/extensions/chef/provider.rb
|
116
|
+
- lib/chefspec/extensions/chef/resource.rb
|
117
|
+
- lib/chefspec/extensions/chef/resource/freebsd_package.rb
|
118
|
+
- lib/chefspec/extensions/chef/run_context/cookbook_compiler.rb
|
119
|
+
- lib/chefspec/extensions/chef/securable.rb
|
120
|
+
- lib/chefspec/extensions/ohai/system.rb
|
121
|
+
- lib/chefspec/file_cache_path_proxy.rb
|
122
|
+
- lib/chefspec/formatter.rb
|
123
|
+
- lib/chefspec/librarian.rb
|
124
|
+
- lib/chefspec/matchers.rb
|
125
|
+
- lib/chefspec/matchers/do_nothing_matcher.rb
|
126
|
+
- lib/chefspec/matchers/include_any_recipe_matcher.rb
|
127
|
+
- lib/chefspec/matchers/include_recipe_matcher.rb
|
128
|
+
- lib/chefspec/matchers/link_to_matcher.rb
|
129
|
+
- lib/chefspec/matchers/notifications_matcher.rb
|
130
|
+
- lib/chefspec/matchers/render_file_matcher.rb
|
131
|
+
- lib/chefspec/matchers/resource_matcher.rb
|
132
|
+
- lib/chefspec/matchers/state_attrs_matcher.rb
|
133
|
+
- lib/chefspec/matchers/subscribes_matcher.rb
|
134
|
+
- lib/chefspec/mixins/normalize.rb
|
135
|
+
- lib/chefspec/policyfile.rb
|
136
|
+
- lib/chefspec/renderer.rb
|
137
|
+
- lib/chefspec/rspec.rb
|
138
|
+
- lib/chefspec/runner.rb
|
139
|
+
- lib/chefspec/server.rb
|
140
|
+
- lib/chefspec/server_methods.rb
|
141
|
+
- lib/chefspec/server_runner.rb
|
142
|
+
- lib/chefspec/solo_runner.rb
|
143
|
+
- lib/chefspec/stubs/command_registry.rb
|
144
|
+
- lib/chefspec/stubs/command_stub.rb
|
145
|
+
- lib/chefspec/stubs/data_bag_item_registry.rb
|
146
|
+
- lib/chefspec/stubs/data_bag_item_stub.rb
|
147
|
+
- lib/chefspec/stubs/data_bag_registry.rb
|
148
|
+
- lib/chefspec/stubs/data_bag_stub.rb
|
149
|
+
- lib/chefspec/stubs/registry.rb
|
150
|
+
- lib/chefspec/stubs/search_registry.rb
|
151
|
+
- lib/chefspec/stubs/search_stub.rb
|
152
|
+
- lib/chefspec/stubs/stub.rb
|
153
|
+
- lib/chefspec/util.rb
|
154
|
+
- lib/chefspec/version.rb
|
155
|
+
- lib/chefspec/zero_server.rb
|
156
|
+
- spec/spec_helper.rb
|
157
|
+
- spec/support/hash.rb
|
158
|
+
- spec/unit/cacher_spec.rb
|
159
|
+
- spec/unit/coverage/filters_spec.rb
|
160
|
+
- spec/unit/deprecations_spec.rb
|
161
|
+
- spec/unit/errors_spec.rb
|
162
|
+
- spec/unit/expect_exception_spec.rb
|
163
|
+
- spec/unit/macros_spec.rb
|
164
|
+
- spec/unit/matchers/do_nothing_matcher.rb
|
165
|
+
- spec/unit/matchers/include_any_recipe_matcher_spec.rb
|
166
|
+
- spec/unit/matchers/include_recipe_matcher_spec.rb
|
167
|
+
- spec/unit/matchers/link_to_matcher_spec.rb
|
168
|
+
- spec/unit/matchers/notifications_matcher_spec.rb
|
169
|
+
- spec/unit/matchers/render_file_matcher_spec.rb
|
170
|
+
- spec/unit/matchers/resource_matcher_spec.rb
|
171
|
+
- spec/unit/matchers/state_attrs_matcher_spec.rb
|
172
|
+
- spec/unit/matchers/subscribes_matcher_spec.rb
|
173
|
+
- spec/unit/renderer_spec.rb
|
174
|
+
- spec/unit/server_runner_spec.rb
|
175
|
+
- spec/unit/solo_runner_spec.rb
|
176
|
+
- spec/unit/stubs/command_registry_spec.rb
|
177
|
+
- spec/unit/stubs/command_stub_spec.rb
|
178
|
+
- spec/unit/stubs/data_bag_item_registry_spec.rb
|
179
|
+
- spec/unit/stubs/data_bag_item_stub_spec.rb
|
180
|
+
- spec/unit/stubs/data_bag_registry_spec.rb
|
181
|
+
- spec/unit/stubs/data_bag_stub_spec.rb
|
182
|
+
- spec/unit/stubs/registry_spec.rb
|
183
|
+
- spec/unit/stubs/search_registry_spec.rb
|
184
|
+
- spec/unit/stubs/search_stub_spec.rb
|
185
|
+
- spec/unit/stubs/stub_spec.rb
|
186
|
+
- templates/coverage/human.erb
|
187
|
+
- templates/coverage/json.erb
|
188
|
+
- templates/coverage/table.erb
|
189
|
+
- templates/errors/cookbook_path_not_found.erb
|
190
|
+
- templates/errors/erb_template_parse_error.erb
|
191
|
+
- templates/errors/gem_load_error.erb
|
192
|
+
- templates/errors/invalid_berkshelf_options.erb
|
193
|
+
- templates/errors/may_need_to_specify_platform.erb
|
194
|
+
- templates/errors/no_conversion_error.erb
|
195
|
+
- templates/errors/not_stubbed.erb
|
196
|
+
- templates/errors/shell_out_not_stubbed.erb
|
197
|
+
- templates/errors/template_not_found.erb
|
198
|
+
homepage: https://github.com/chef/chefspec
|
199
|
+
licenses:
|
200
|
+
- MIT
|
201
|
+
metadata: {}
|
202
|
+
post_install_message:
|
203
|
+
rdoc_options: []
|
204
|
+
require_paths:
|
205
|
+
- lib
|
206
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
207
|
+
requirements:
|
208
|
+
- - ">="
|
209
|
+
- !ruby/object:Gem::Version
|
210
|
+
version: '2.5'
|
211
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
requirements: []
|
217
|
+
rubygems_version: 3.1.4
|
218
|
+
signing_key:
|
219
|
+
specification_version: 4
|
220
|
+
summary: Write RSpec examples and generate coverage reports for Chef recipes!
|
221
|
+
test_files: []
|