summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2016-04-04 16:35:28 -0700
committerThom May <thom@chef.io>2016-04-04 16:42:50 -0700
commitfb7ad1505d0257a10a4dcc984fbb898d02e9754d (patch)
tree77756de0187b779cbbbf4fad2a84eb5de9a86936 /spec
parent90cf8d0a1c64bea5c06bf1957c8e84ebdbf66dd2 (diff)
downloadchef-fb7ad1505d0257a10a4dcc984fbb898d02e9754d.tar.gz
Add a NoOp providertm/provider_no_op
This allows one to have a resource which is really only appropriate for one platform, but available everywhere. Then you simply allow noop to provide the resource everywhere besides where it's supposed to be.
Diffstat (limited to 'spec')
-rw-r--r--spec/integration/recipes/noop_resource_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/integration/recipes/noop_resource_spec.rb b/spec/integration/recipes/noop_resource_spec.rb
new file mode 100644
index 0000000000..c8ff3e6b5e
--- /dev/null
+++ b/spec/integration/recipes/noop_resource_spec.rb
@@ -0,0 +1,24 @@
+require "support/shared/integration/integration_helper"
+
+describe "Resources with a no-op provider" do
+ include IntegrationSupport
+
+ context "with noop provider providing foo" do
+ before(:context) {
+ class NoOpFoo < Chef::Resource
+ resource_name "hi_there"
+ default_action :update
+ end
+ Chef::Provider::Noop.provides :hi_there
+ }
+
+ it "does not blow up a run with a noop'd resource" do
+ recipe = converge {
+ hi_there "blah" do
+ action :update
+ end
+ }
+ expect(recipe.logged_warnings).to eq ""
+ end
+ end
+end