summaryrefslogtreecommitdiff
path: root/t/test-custodian-alertfactory.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-24 16:32:35 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-24 16:32:35 +0000
commit31054d667bfec0227e0973b35b6a5137c56ffcd1 (patch)
tree70281ef425a2ed938e092317d75cc94d7dffcc64 /t/test-custodian-alertfactory.rb
parent50a392b21a03476127ba1339ebf8c09146fa0c30 (diff)
The argument to our class factories must be a non-nil string.
Diffstat (limited to 't/test-custodian-alertfactory.rb')
-rwxr-xr-xt/test-custodian-alertfactory.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/test-custodian-alertfactory.rb b/t/test-custodian-alertfactory.rb
index ede6aa7..4f2fb8d 100755
--- a/t/test-custodian-alertfactory.rb
+++ b/t/test-custodian-alertfactory.rb
@@ -51,6 +51,25 @@ class TestAlertFactory < Test::Unit::TestCase
assert( obj.respond_to? "raise" )
assert( obj.respond_to? "clear" )
end
+
+
+ #
+ # Creating an alert we don't know about is an error
+ #
+ assert_raise ArgumentError do
+ obj = Custodian::AlertFactory.create( "not found", nil )
+ end
+
+ #
+ # A string is mandatory
+ #
+ assert_raise ArgumentError do
+ obj = Custodian::AlertFactory.create( nil, nil )
+ end
+ assert_raise ArgumentError do
+ obj = Custodian::AlertFactory.create( Array.new, nil )
+ end
+
end
end