From c8d16b7511969edbde58bc49ef44e0ff63e5cb8f Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Tue, 17 Apr 2012 11:14:35 +0100 Subject: * DuringRunner#now? caches its answer, indexed by time. The cache is renewed on reinitialization. * AlertGroup#notify now initialises and keeps track of each DuringRunner to ensure cache usage. --- test/tc_mauve_notification.rb | 51 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'test') diff --git a/test/tc_mauve_notification.rb b/test/tc_mauve_notification.rb index 0b3bc04..ec5eaf6 100644 --- a/test/tc_mauve_notification.rb +++ b/test/tc_mauve_notification.rb @@ -315,4 +315,55 @@ EOF end + # + # Test to make sure that if a bondary is crossed, then the during clauses all + # work. + # + def test_no_race_conditions_in_during + + config=< "test", + :source => "test", + :subject => "test" + ) + alert.raise! + + a = AlertChanged.first + assert_equal("urgent", a.level, "Level is wrong for #{a.person}") + assert_equal("raised", a.update_type, "Update type is wrong for #{a.person}") + + assert_equal(1, Server.instance.notification_buffer.size, "Wrong number of notifications sent") + end + + end -- cgit v1.2.1