aboutsummaryrefslogtreecommitdiff
path: root/test/tc_mauve_configuration_builders_person.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-04-23 11:37:38 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-04-23 11:37:38 +0100
commitca99b0dff974d2fc841d7132d03b3ad1d1bf9b1e (patch)
tree69f949ec5c8a3396222815eacf9109d516de8c84 /test/tc_mauve_configuration_builders_person.rb
parentc3592bdf6fce6f234de37959c677f75d97b1134d (diff)
People/PeopleLists can now specify individualy notification times/frequencies
* Added PeopleList builder * Added Person#during, PeopleList#during, Person#every, PeopleList#every * Notification now uses #during/#every from the Person/PeopleList if nothing was specified * Added tests
Diffstat (limited to 'test/tc_mauve_configuration_builders_person.rb')
-rw-r--r--test/tc_mauve_configuration_builders_person.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/tc_mauve_configuration_builders_person.rb b/test/tc_mauve_configuration_builders_person.rb
index 61a6202..391d796 100644
--- a/test/tc_mauve_configuration_builders_person.rb
+++ b/test/tc_mauve_configuration_builders_person.rb
@@ -2,10 +2,37 @@ $:.unshift "../lib/"
require 'th_mauve'
require 'mauve/configuration_builders/person'
+require 'pp'
class TcMauveConfigurationBuildersPerson < Mauve::UnitTest
def test_load
+ config=<<EOF
+person("test1") {
+ all { "this should email on every level" }
+ during { "this is the during block" }
+ every 300
+ email "test1@example.com"
+ sms "01234567890"
+ xmpp "test1@chat.example.com"
+ password "topsekrit"
+}
+EOF
+
+ x = nil
+ assert_nothing_raised { x = Mauve::ConfigurationBuilder.parse(config) }
+ assert_equal(1, x.people.length)
+ assert_equal(%w(test1), x.people.keys)
+ assert_equal(300, x.people["test1"].every)
+ assert_equal("test1@example.com", x.people["test1"].email)
+ assert_equal("01234567890", x.people["test1"].sms)
+ assert_equal("test1@chat.example.com", x.people["test1"].xmpp)
+ assert_equal("topsekrit", x.people["test1"].password)
+
+ assert_equal("this is the during block", x.people["test1"].during.call)
+ assert_equal("this should email on every level", x.people["test1"].urgent.call)
+ assert_equal("this should email on every level", x.people["test1"].normal.call)
+ assert_equal("this should email on every level", x.people["test1"].low.call)
end