diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-06-28 19:08:08 -0700 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-06-30 09:41:03 -0700 |
commit | 0b1466e4fe4e2652e271f8b4205a554fafe01284 (patch) | |
tree | eb3a414540219fbf8ff3411f47ffc4987a3bfbc6 | |
parent | 2b554c44b73f629a5425f94257d48229a04cc459 (diff) | |
download | chef-0b1466e4fe4e2652e271f8b4205a554fafe01284.tar.gz |
Added spec for #3607
-rw-r--r-- | spec/unit/lwrp_spec.rb | 10 |
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 |