From 1fd332a69d222293581b25fb2fa892ddbccd305c Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Wed, 18 Feb 2015 05:41:02 +0000 Subject: Correctly parse tests with multiple implementation-types. We now parse a single test-definition into multiple test-implementations. This isn't required here because the parser only needs to know that the configuration file *can* be parsed, not what the result is. Validate that we got an array, but otherwise ignore the results after the first. --- lib/custodian/parser.rb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'lib/custodian/parser.rb') diff --git a/lib/custodian/parser.rb b/lib/custodian/parser.rb index d32b9c9..fb35cd5 100644 --- a/lib/custodian/parser.rb +++ b/lib/custodian/parser.rb @@ -337,8 +337,23 @@ module Custodian job = nil begin + + # + # We need to parse the job with the class-factory + # + # BUT the key thing here is that the line is parseable, + # not that we care about the result of that parsing. + # + # The result of the parsing will be an array and if so + # we just need to store the first job. Since it is duplicated + # if there are multiple handlers and we should always have one - + # or an unknown job-type of course! + # job = Custodian::TestFactory.create( macro_expanded ) - ret.push( job ) + + if ( job && ( job.kind_of? Array ) ) + ret.push( job[0].to_s ) + end rescue => ex raise ArgumentError, "Parsing a line to a protocol test gave the error: #{ex}" return nil -- cgit v1.2.1