# File lib/rcodetools/xmptestunitfilter.rb, line 54
54: def _value_assertions(klass_value_txt_pair, expression)
55: klass_txt, value_txt = klass_value_txt_pair
56: value = eval(value_txt) || OTHER.new
57: # special cases
58: value = nil if value_txt.strip == "nil"
59: value = false if value_txt.strip == "false"
60: value_assertions klass_txt, value_txt, value, expression
61: rescue Exception
62: return object_assertions(klass_txt, value_txt, expression)
63: end
# File lib/rcodetools/xmptestunitfilter.rb, line 15
15: def annotated_line(line, expression, runtime_data, idx)
16: indent = /^\s*/.match(line)[0]
17: assertions(expression.strip, runtime_data, idx).map{|x| indent + x}.join("\n")
18: end
# File lib/rcodetools/xmptestunitfilter.rb, line 25
25: def assertions(expression, runtime_data, index)
26: exceptions = runtime_data.exceptions
27: ret = []
28:
29: unless (vars = runtime_data.bindings[index]).empty?
30: vars.each{|var| ret << equal_assertion(var, expression) }
31: end
32: if !(wanted = runtime_data.results[index]).empty? || !exceptions[index]
33: case (wanted[0][1] rescue 1)
34: when "nil"
35: ret.concat nil_assertion(expression)
36: else
37: case wanted.size
38: when 1
39: ret.concat _value_assertions(wanted[0], expression)
40: else
41: # discard values from multiple runs
42: ret.concat(["#xmpfilter: WARNING!! extra values ignored"] +
43: _value_assertions(wanted[0], expression))
44: end
45: end
46: else
47: ret.concat raise_assertion(expression, exceptions, index)
48: end
49:
50: ret
51: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.