diff options
author | Steve Kemp <steve@steve.org.uk> | 2015-02-18 05:41:02 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2015-02-18 05:41:02 +0000 |
commit | 382132a84fa3aaf752150a4d6a881dbb8b71fa66 (patch) | |
tree | e3a356ead1dc7af22a937be09e68397dec74cd1d /lib/custodian | |
parent | 19db604764382bcf052893b8a6bb07e168e430b1 (diff) |
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.
Diffstat (limited to 'lib/custodian')
-rw-r--r-- | lib/custodian/parser.rb | 17 |
1 files changed, 16 insertions, 1 deletions
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 |