summaryrefslogtreecommitdiff
path: root/lib/custodian/testfactory.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-25 22:19:29 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-25 22:19:29 +0000
commit8d59cc01d1b5f1dae91e5010bdb0493434d70a72 (patch)
tree744a9b989ce986efd16f417046b3ad32be0fb114 /lib/custodian/testfactory.rb
parent01b04cb3bb81c50e3865ca3656e9c4ccc75f9f02 (diff)
Parse the "otherwise 'xxxx'." part of the tests.
Diffstat (limited to 'lib/custodian/testfactory.rb')
-rw-r--r--lib/custodian/testfactory.rb36
1 files changed, 35 insertions, 1 deletions
diff --git a/lib/custodian/testfactory.rb b/lib/custodian/testfactory.rb
index ccfc89e..603b69f 100644
--- a/lib/custodian/testfactory.rb
+++ b/lib/custodian/testfactory.rb
@@ -43,7 +43,19 @@ module Custodian
test_type.chomp!( "." )
c = @@subclasses[test_type]
if c
- c.new( line )
+
+ obj = c.new( line )
+
+ #
+ # Get the notification text, which is not specific to the test-type
+ #
+ # We do this only after we've instantiated the test.
+ #
+ if ( line =~ /\s+otherwise\s+'([^']+)'/ )
+ obj.set_notification_text( $1.dup )
+ end
+
+ return obj
else
raise ArgumentError, "Bad test type: '#{test_type}'"
end
@@ -94,6 +106,27 @@ module Custodian
+
+ #
+ # Return the user-text which is returned on error
+ #
+ def get_notification_text
+ @notification_text
+ end
+
+
+
+
+ #
+ # Set the user-text which is returned on error.
+ #
+ def set_notification_text( str )
+ @notification_text = str
+ end
+
+
+
+
#
# Is this test inverted?
#
@@ -102,6 +135,7 @@ module Custodian
end
+
#
# Return the port of this test.
#