lib/qed/evaluator.rb in qed-2.5.0 vs lib/qed/evaluator.rb in qed-2.5.1

- old
+ new

@@ -65,34 +65,57 @@ begin advise!(:desc, step) advise!(:when, step) # triggers matchers rescue SystemExit pass!(step) - rescue Assertion => exception - fail!(step, exception) + #rescue Assertion => exception + # fail!(step, exception) rescue Exception => exception - error!(step, exception) + if exception.assertion? + fail!(step, exception) + else + error!(step, exception) + end else pass!(step) end end # def evaluate_data(step) - advise!(:data, step) + #advise!(:data, step) + begin + advise!(:data, step) + rescue SystemExit + pass!(step) + #rescue Assertion => exception + # fail!(step, exception) + rescue Exception => exception + if exception.assertion? + fail!(step, exception) + else + error!(step, exception) + end + else + pass!(step) + end end # Evaluate a demo step. def evaluate_code(step) begin advise!(:code, step) @script.evaluate(step.code, step.lineno) rescue SystemExit - pass!(step) - rescue Assertion => exception - fail!(step, exception) + pass!(step) # TODO: skip!(step) + #rescue Assertion => exception + # fail!(step, exception) rescue Exception => exception - error!(step, exception) + if exception.assertion? + fail!(step, exception) + else + error!(step, exception) + end else pass!(step) end end