summaryrefslogtreecommitdiff
path: root/spec/unit/resource_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/resource_spec.rb')
-rw-r--r--spec/unit/resource_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index ffcc7ae5b4..701481e882 100644
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -35,6 +35,21 @@ describe Chef::Resource do
@resource = Chef::Resource.new("funk", @run_context)
end
+ describe "when inherited" do
+
+ it "adds an entry to a list of subclasses" do
+ subclass = Class.new(Chef::Resource)
+ Chef::Resource.resource_classes.should include(subclass)
+ end
+
+ it "keeps track of subclasses of subclasses" do
+ subclass = Class.new(Chef::Resource)
+ subclass_of_subclass = Class.new(subclass)
+ Chef::Resource.resource_classes.should include(subclass_of_subclass)
+ end
+
+ end
+
describe "when declaring the identity attribute" do
it "has no identity attribute by default" do
Chef::Resource.identity_attr.should be_nil