From 0dcad9a755375faf48b4149624d2249da759ddd3 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sat, 6 Dec 2014 12:26:08 -0800 Subject: [PATCH] Test eval syntax errors --- test/test_execjs.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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'")