diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-03-31 12:24:00 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2017-03-31 14:09:07 -0700 |
commit | 1b0cc1b541a9015fc925fc5d1ada6f85934fc0c7 (patch) | |
tree | 8a6f2b2c99faa926c705216a47fb0d1f94cd1cf0 /spec/integration | |
parent | 5dacd74ce5cccc4dbb651a45f9e591dd1921cc6e (diff) | |
download | chef-1b0cc1b541a9015fc925fc5d1ada6f85934fc0c7.tar.gz |
Chef-13: fix notifying array resources
this also deprecates the multi-resource notification syntax where
`foo[a,b]` would attempt to notify both `foo[a]` and `foo[b]` because
that is hella ambiguous.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/integration')
-rw-r--r-- | spec/integration/recipes/notifies_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/integration/recipes/notifies_spec.rb b/spec/integration/recipes/notifies_spec.rb index 6f6a0f06b0..b008e4ade7 100644 --- a/spec/integration/recipes/notifies_spec.rb +++ b/spec/integration/recipes/notifies_spec.rb @@ -362,4 +362,33 @@ EOM result.error! end end + + when_the_repository "has resources that have arrays as the name" do + before do + directory "cookbooks/x" do + file "recipes/default.rb", <<-EOM + log [ "a", "b" ] do + action :nothing + end + + log "doit" do + notifies :write, "log[a, b]" + end + EOM + end + end + + it "notifying the resource should work" do + file "config/client.rb", <<EOM +local_mode true +cookbook_path "#{path_to('cookbooks')}" +log_level :warn +EOM + + result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", :cwd => chef_dir) + expect(result.stdout).to match /\* log\[a, b\] action write/ + result.error! + end + + end end |