From 69a2e1ecbb08f3d1bf6fa779caa94e41f126a589 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Mon, 14 Jan 2013 10:26:54 +0000 Subject: Test we get an error on non-strings. --- t/test-custodian-parser.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/test-custodian-parser.rb b/t/test-custodian-parser.rb index 1448a1d..1a5be6e 100755 --- a/t/test-custodian-parser.rb +++ b/t/test-custodian-parser.rb @@ -68,7 +68,13 @@ class TestCustodianParser < Test::Unit::TestCase result = parser.parse_line( "# this is a comment" ) assert( result.nil? ) - # 1.b. Adding a test will return an array of test-objects. + # 1.b. Non-strings are an error + assert_raise ArgumentError do + result = parser.parse_line( nil ) + end + + + # 1.c. Adding a test will return an array of test-objects. result = parser.parse_line( "smtp.bytemark.co.uk must run smtp on 25 otherwise 'failure'." ); assert( !result.nil? ) assert( result.kind_of? Array ) -- cgit v1.2.1