diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-03-21 14:51:46 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2017-03-21 14:51:46 -0700 |
commit | d23db7c88801551ef92af553764d0a38cc5d75f5 (patch) | |
tree | 64c147b77dd5c9edcacd94715c5da7061bacc1d1 /spec/unit/property_spec.rb | |
parent | 3099264e4e44c4615622f1d69fc040a5d4d90500 (diff) | |
download | chef-d23db7c88801551ef92af553764d0a38cc5d75f5.tar.gz |
Chef-13: Simplify DSL creation
we did actually have tests around creating actions with spaces and
hyphens in their names. we had fallback code for properties, but it
was broken and threw a "private method define_resource called" and then
it created a closure and didn't have the `name` in the binding so it
called itself and blew up the stack.
this change walks that back. it does prove that we still support
UTF-8 in property names, actions and DSL names, which i'd argue is
more than enough.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit/property_spec.rb')
-rw-r--r-- | spec/unit/property_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/unit/property_spec.rb b/spec/unit/property_spec.rb index faeb774057..bd90891b63 100644 --- a/spec/unit/property_spec.rb +++ b/spec/unit/property_spec.rb @@ -108,6 +108,16 @@ describe "Chef::Resource.property" do end end + with_property ":Straße" do + it "properties with UTF-8 in their name work" do + expect(resource.Straße).to eql(nil) + expect(resource.Straße "foo").to eql("foo") + expect(resource.Straße).to eql("foo") + expect(resource.Straße = "bar").to eql("bar") + expect(resource.Straße).to eql("bar") + end + end + with_property ":x, name_property: true" do context "and subclass" do let(:subresource_class) do |