Commit 79c46187 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2975 from yasuyuki/eval_rescue

Add regression test for #2933
parents e1ec2b02 49bfaca6
......@@ -78,3 +78,22 @@ assert('Kernel.#eval(string) context') do
assert_equal('class') { obj.const_string }
end
assert('Object#instance_eval with begin-rescue-ensure execution order') do
class HellRaiser
def raise_hell
order = [:enter_raise_hell]
begin
order.push :begin
self.instance_eval("raise 'error'")
rescue
order.push :rescue
ensure
order.push :ensure
end
order
end
end
hell_raiser = HellRaiser.new
assert_equal([:enter_raise_hell, :begin, :rescue, :ensure], hell_raiser.raise_hell)
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment