summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-06-28 19:08:08 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2015-06-30 11:50:38 -0700
commitf353e3b63432db39d74c66fb9fa4e90bb6c66695 (patch)
tree04b6111f99123c570e7b798c9f81f302dfd7c420
parent1d25d780a69ebc118494939a8d315f6ec6d9ad3f (diff)
downloadchef-f353e3b63432db39d74c66fb9fa4e90bb6c66695.tar.gz
Added spec for #3607
-rw-r--r--spec/unit/lwrp_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/unit/lwrp_spec.rb b/spec/unit/lwrp_spec.rb
index 55df9cb8fa..7e2ed998b8 100644
--- a/spec/unit/lwrp_spec.rb
+++ b/spec/unit/lwrp_spec.rb
@@ -177,6 +177,16 @@ describe "LWRP" do
end
end
+ it "allows monkey patching of the lwrp through Chef::Resource" do
+ monkey = Module.new do
+ def issue_3607
+ end
+ end
+ allow(Chef::Config).to receive(:[]).with(:treat_deprecation_warnings_as_errors).and_return(false)
+ Chef::Resource::LwrpFoo.send(:include, monkey)
+ expect { get_lwrp(:lwrp_foo).new("blah").issue_3607 }.not_to raise_error
+ end
+
it "should load the resource into a properly-named class and emit a warning when it is initialized" do
expect { Chef::Resource::LwrpFoo.new('hi') }.to raise_error(Chef::Exceptions::DeprecatedFeatureError)
end