diff options
author | John Keiser <john@johnkeiser.com> | 2015-05-28 11:32:10 -0700 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-06-01 08:02:05 -0700 |
commit | 46e3f2258b1b04ca6030b5ef1575adadaa920e08 (patch) | |
tree | f59066b287aee399b923de9346be4a42f4e20924 /spec/unit/resource_spec.rb | |
parent | 5998cc7315507e649bb76f139c07715f6e590707 (diff) | |
download | chef-46e3f2258b1b04ca6030b5ef1575adadaa920e08.tar.gz |
Add use_automatic_resource_name
Diffstat (limited to 'spec/unit/resource_spec.rb')
-rw-r--r-- | spec/unit/resource_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index 2e0a88f555..bc5567b73a 100644 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -399,6 +399,20 @@ describe Chef::Resource do expect(r.resource_name).to eq :blah expect(r.declared_type).to eq :d end + it "use_automatic_resource_name yields a resource name from the class name" do + class SelfResourceNameTestBlahDBlah4 < Chef::Resource + use_automatic_resource_name + end + + c = SelfResourceNameTestBlahDBlah4 + + r = c.new('hi') + r.declared_type = :d + expect(c.resource_name).to eq :self_resource_name_test_blah_d_blah4 + expect(r.resource_name).to eq :self_resource_name_test_blah_d_blah4 + expect(r.declared_type).to eq :d + + end end describe "is" do |