test/test_safemode_parser.rb in safemode-1.3.1 vs test/test_safemode_parser.rb in safemode-1.3.2
- old
+ new
@@ -29,9 +29,15 @@
assert_nothing_raised do
jail('@output_buffer = ""')
end
end
+ def test_block_pass_is_disabled
+ assert_raise Safemode::SecurityError do
+ jail('[].each(&:delete)')
+ end
+ end
+
private
def assert_jailed(expected, code)
assert_equal expected.gsub(' ', ''), jail(code).gsub(' ', '')
end