aboutsummaryrefslogtreecommitdiff
path: root/test/tc_mauve_people_list.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-04-25 17:15:49 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-04-25 17:15:49 +0100
commite959c0fe4c887154bbe28c31324fef2975cbe467 (patch)
tree3088c7a1f389944d613e57b551b452f7ec83181d /test/tc_mauve_people_list.rb
parent5fff12fc11cb8b02a44fd40ed78fa9d196f269d7 (diff)
Big update.
* Max acknowledgement time is now specified in the config * Calendar interface improved. * holiday_url no longer used -- replaced by notify_when_on_holiday! * added notify_when_off_sick! * Added ability for the calendar to be queried for a list of bank holdays. * Added ability for Time to be given a list of bank holidays to check against. * PeopleLists can now be a Proc, allowing downloading of lists * Person is no longer a struct * Moved the method_missing bit into ObjectBuilder from various sub classes. * Added tests for the calendar interface * Updated tests in other bits.
Diffstat (limited to 'test/tc_mauve_people_list.rb')
-rw-r--r--test/tc_mauve_people_list.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/tc_mauve_people_list.rb b/test/tc_mauve_people_list.rb
index 2d5da6d..fd8bda9 100644
--- a/test/tc_mauve_people_list.rb
+++ b/test/tc_mauve_people_list.rb
@@ -117,4 +117,29 @@ EOF
end
end
+
+ def test_dynamic_people_list
+ #
+ # Allows us to pick up notifications sent.
+ #
+ $sent_notifications = []
+
+ config =<<EOF
+
+person "test1"
+
+person "test2"
+
+#
+# This should oscillate between test1 and test2.
+#
+people_list "testers", lambda { $ans = ($ans == "test1" ? "test2" : "test1") }
+
+EOF
+ Configuration.current = ConfigurationBuilder.parse(config)
+ people_list = Configuration.current.people_lists["testers"]
+ assert_equal([Configuration.current.people["test1"]], people_list.people)
+ assert_equal([Configuration.current.people["test2"]], people_list.people)
+ end
+
end