diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-06-26 13:36:44 -0700 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-06-30 07:12:11 -0700 |
commit | aa9a062464c311abed4161886646de2b2ce13205 (patch) | |
tree | 838cdb1008250ba0fe90ff85484445b76eb22bba | |
parent | bcbe1fc82f5afdad1c8b6a855a4108443d1cb729 (diff) | |
download | chef-aa9a062464c311abed4161886646de2b2ce13205.tar.gz |
Get tests passing
-rw-r--r-- | lib/chef/resource/lwrp_base.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/chef/resource/lwrp_base.rb b/lib/chef/resource/lwrp_base.rb index 0a1cb6aa72..424efa73d9 100644 --- a/lib/chef/resource/lwrp_base.rb +++ b/lib/chef/resource/lwrp_base.rb @@ -78,11 +78,26 @@ class Chef resource_class = Class.new(deprecated_resource_class).tap do |resource_class| resource_class.resource_name(resource_name.to_sym) + resource_class.run_context = run_context resource_class.instance_eval do define_method(:chef_deprecated_access) do false end end + resource_class.class_eval do + define_singleton_method(:===) do |instance| + super(instance) || instance.class <= deprecated_resource_class + end + end + end + + deprecated_resource_class.class_eval do + define_method(:kind_of?) do |klass| + super(klass) || klass == resource_class + end + define_method(:is_a?) do |klass| + super(klass) || klass == resource_class + end end Chef::Log.debug("Loaded contents of #{filename} into resource #{resource_name} (#{resource_class})") |