diff options
author | Thom May <thom@chef.io> | 2016-04-04 16:35:28 -0700 |
---|---|---|
committer | Thom May <thom@chef.io> | 2016-04-04 16:42:50 -0700 |
commit | fb7ad1505d0257a10a4dcc984fbb898d02e9754d (patch) | |
tree | 77756de0187b779cbbbf4fad2a84eb5de9a86936 /spec | |
parent | 90cf8d0a1c64bea5c06bf1957c8e84ebdbf66dd2 (diff) | |
download | chef-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.rb | 24 |
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 |