aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-04-27 10:58:36 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-04-27 10:58:36 +0100
commit5ad5aea6512f43a06e720d0b8e0fbf405d532dca (patch)
tree12d91d81962bf32972ddd6097c815e2ccdad9cd3 /test
parent050d56934033c1cb1c2a6e613c706e3415acbd53 (diff)
Added default configuration options for a person.
Diffstat (limited to 'test')
-rw-r--r--test/tc_mauve_configuration_builders_person.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/tc_mauve_configuration_builders_person.rb b/test/tc_mauve_configuration_builders_person.rb
index d889a03..6ee3d13 100644
--- a/test/tc_mauve_configuration_builders_person.rb
+++ b/test/tc_mauve_configuration_builders_person.rb
@@ -39,4 +39,28 @@ EOF
end
+ def test_default_settings
+ config=<<EOF
+person("test")
+EOF
+ x = nil
+ assert_nothing_raised { x = Mauve::ConfigurationBuilder.parse(config) }
+ person = x.people["test"]
+
+ assert_equal(nil, person.sms)
+ assert_equal(nil, person.email)
+ assert_equal(nil, person.xmpp)
+
+ assert_kind_of(Proc, person.low)
+ assert_kind_of(Proc, person.normal)
+ assert_kind_of(Proc, person.urgent)
+
+ assert_kind_of(Hash, person.notification_thresholds)
+ assert_equal(1,person.notification_thresholds.keys.length)
+ assert(person.notification_thresholds.all?{|k,v| k.is_a?(Integer) and v.is_a?(Array)})
+
+ assert_kind_of(Array, person.notifications)
+ assert_equal(1, person.notifications.length)
+ end
+
end