diff options
Diffstat (limited to 'test/tc_mauve_people_list.rb')
-rw-r--r-- | test/tc_mauve_people_list.rb | 25 |
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 |