mirror of
https://github.com/rails/execjs
synced 2023-03-27 23:21:20 -04:00
Test eval syntax errors
This commit is contained in:
parent
13053caed1
commit
0dcad9a755
1 changed files with 7 additions and 1 deletions
|
@ -152,12 +152,18 @@ class TestExecJS < Test
|
||||||
assert ExecJS.exec("function foo() {\n#{body}\n};\nreturn true")
|
assert ExecJS.exec("function foo() {\n#{body}\n};\nreturn true")
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_syntax_error
|
def test_exec_syntax_error
|
||||||
assert_raises ExecJS::RuntimeError do
|
assert_raises ExecJS::RuntimeError do
|
||||||
ExecJS.exec(")")
|
ExecJS.exec(")")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_eval_syntax_error
|
||||||
|
assert_raises ExecJS::RuntimeError do
|
||||||
|
ExecJS.eval(")")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_thrown_exception
|
def test_thrown_exception
|
||||||
assert_raises ExecJS::ProgramError do
|
assert_raises ExecJS::ProgramError do
|
||||||
ExecJS.exec("throw 'hello'")
|
ExecJS.exec("throw 'hello'")
|
||||||
|
|
Loading…
Reference in a new issue