lib/rast/rast_spec.rb in rast-0.14.0 vs lib/rast/rast_spec.rb in rast-0.15.1

- old
+ new

@@ -1,7 +1,9 @@ # frozen_string_literal: true +require 'rast/rules/rule_evaluator' + # CaseFixture.java, containing an actual and specific combination of variables. class RastSpec # token_converter is the mapping of a variable token to a converter # converters is a list of converters used via positional tokens. attr_reader :variables, :pair, :pair_reversed, :rule, :description, @@ -30,10 +32,11 @@ @converters = converters @token_converter = {} @variables.keys.each_with_index do |key, index| @variables[key].each do |element| - @token_converter[element.to_s] = converters[index] + converter = RuleEvaluator::DEFAULT_CONVERT_HASH[element.class] || converters[index] + @token_converter[element.to_s] = converter end end self end