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 07:12:11 -0700
commit1eec58ab57c6a7c13632ba358c17157557a31c79 (patch)
tree256507e6e4339af3fb650a38e8d15065ff97dd91
parentaa9a062464c311abed4161886646de2b2ce13205 (diff)
downloadchef-1eec58ab57c6a7c13632ba358c17157557a31c79.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