summaryrefslogtreecommitdiff
path: root/spec/unit/property_spec.rb
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-09-29 16:06:41 -0700
committerJohn Keiser <john@johnkeiser.com>2015-09-29 18:27:46 -0700
commitd1a0e4b9dc4b5f00ce7fa5d56866fa0cbe8413e9 (patch)
tree551a2fd1bce54daad84e3d248b571a38a1d554f0 /spec/unit/property_spec.rb
parentd0d9e5b7a6973fbb250b9344038c2e79deb28599 (diff)
downloadchef-d1a0e4b9dc4b5f00ce7fa5d56866fa0cbe8413e9.tar.gz
Add ability for default to override name_propertyjk/name-default
Diffstat (limited to 'spec/unit/property_spec.rb')
-rw-r--r--spec/unit/property_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/property_spec.rb b/spec/unit/property_spec.rb
index 456da89dcf..9ecf7a4cde 100644
--- a/spec/unit/property_spec.rb
+++ b/spec/unit/property_spec.rb
@@ -142,6 +142,18 @@ describe "Chef::Resource.property" do
expect(subresource.x).to be_nil
end
end
+
+ context "with property :x, default: 10 on the subclass" do
+ before do
+ subresource_class.class_eval do
+ property :x, default: 10
+ end
+ end
+
+ it "x is no longer name_property" do
+ expect(subresource.x).to eq(10)
+ end
+ end
end
end