diff --git a/test/test_execjs.rb b/test/test_execjs.rb index 16cab70..591caff 100644 --- a/test/test_execjs.rb +++ b/test/test_execjs.rb @@ -152,12 +152,18 @@ class TestExecJS < Test assert ExecJS.exec("function foo() {\n#{body}\n};\nreturn true") end - def test_syntax_error + def test_exec_syntax_error assert_raises ExecJS::RuntimeError do ExecJS.exec(")") end end + def test_eval_syntax_error + assert_raises ExecJS::RuntimeError do + ExecJS.eval(")") + end + end + def test_thrown_exception assert_raises ExecJS::ProgramError do ExecJS.exec("throw 'hello'")