summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorNuo Yan <nuoyan@nuo-yans-macbook-pro.local>2009-04-27 16:27:33 -0700
committerNuo Yan <nuoyan@nuo-yans-macbook-pro.local>2009-04-27 16:27:33 -0700
commit5e582910f867f4e0c8d89eb21cb7622ddc14527f (patch)
treec8c8a702fd31c00ebba58e1c3056fd92ea885b68 /features
parent5921812c46b0b5a39a49d4ff79e5af1d0d4d154d (diff)
downloadchef-5e582910f867f4e0c8d89eb21cb7622ddc14527f.tar.gz
fixed CHEF-122
Diffstat (limited to 'features')
-rw-r--r--features/data/cookbooks/delayed_notifications/recipes/notify_different_resources_for_different_actions.rb31
-rw-r--r--features/delayed_notifications.feature8
2 files changed, 38 insertions, 1 deletions
diff --git a/features/data/cookbooks/delayed_notifications/recipes/notify_different_resources_for_different_actions.rb b/features/data/cookbooks/delayed_notifications/recipes/notify_different_resources_for_different_actions.rb
new file mode 100644
index 0000000000..3180bbe4c2
--- /dev/null
+++ b/features/data/cookbooks/delayed_notifications/recipes/notify_different_resources_for_different_actions.rb
@@ -0,0 +1,31 @@
+#
+# Cookbook Name:: delayed_notifications
+# Recipe:: notify_different_resources_for_different_actions
+#
+# Copyright 2009, Opscode
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+file "#{node[:tmpdir]}/notified_file_2.txt" do
+ action :nothing
+end
+
+file "#{node[:tmpdir]}/notified_file_3.txt" do
+ action :nothing
+end
+
+execute "echo foo" do
+ notifies([{resources("file[#{node[:tmpdir]}/notified_file_2.txt]") => [:create, :delayed]},
+ {resources("file[#{node[:tmpdir]}/notified_file_3.txt]") => [:create, :delayed]}])
+end
diff --git a/features/delayed_notifications.feature b/features/delayed_notifications.feature
index de86f4a240..bc874f0f5e 100644
--- a/features/delayed_notifications.feature
+++ b/features/delayed_notifications.feature
@@ -17,5 +17,11 @@ Feature: Delayed Notifications
Then the run should exit '0'
And a file named 'notified_file.txt' should contain 'bob dylan' only '1' time
-
+ Scenario: Notify different resources for different actions
+ Given a validated node
+ And it includes the recipe 'delayed_notifications::notify_different_resources_for_different_actions'
+ When I run the chef-client
+ Then the run should exit '0'
+ And a file named 'notified_file_2.txt' should exist
+ And a file named 'notified_file_3.txt' should exist