# File test.rb, line 808 def test_raise_on_error p = PageTemplate::Parser.new template = p.parse("[% var foo.bar %]") foo = "hello" def foo.bar asdf # method unknown error end template["foo"] = foo assert_equal( template.output, "[ Error: undefined local variable or method `asdf' for \"hello\":String ]", "With raise_on_error not set, we get error strings") p.args['raise_on_error'] = true assert_raises(NameError, "With raise on error set, user has to catch errors") { template.output } rescue Exception => er puts "error: #{er.class}" end