mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_object.rb: new tests to achieve over 90% test
coverage of object.c, eval.c and eval_method.c. * test/ruby/test_module.rb: ditto. * test/ruby/test_trace.rb: ditto. * test/ruby/test_integer.rb: ditto. * test/ruby/test_float.rb: ditto. * test/ruby/test_method.rb: ditto. * test/ruby/test_variable.rb: ditto. * test/ruby/test_eval.rb: ditto. * test/ruby/test_exception.rb: ditto. * test/ruby/test_class.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e4f8e61ddd
commit
f09f597422
11 changed files with 882 additions and 0 deletions
|
@ -358,4 +358,21 @@ class TestEval < Test::Unit::TestCase
|
|||
}
|
||||
end
|
||||
|
||||
def test_eval_using_integer_as_binding
|
||||
assert_raise(TypeError) { eval("", 1) }
|
||||
end
|
||||
|
||||
def test_eval_raise
|
||||
assert_raise(RuntimeError) { eval("raise ''") }
|
||||
end
|
||||
|
||||
def test_eval_using_untainted_binding_under_safe4
|
||||
assert_raise(SecurityError) do
|
||||
Thread.new do
|
||||
b = binding
|
||||
$SAFE = 4
|
||||
eval("", b)
|
||||
end.join
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue