Commit de65d4e2 authored by take_cheeze's avatar take_cheeze

make behavior of Fiber without block compatible with CRuby

parent daaedf32
......@@ -73,7 +73,7 @@ fiber_init(mrb_state *mrb, mrb_value self)
mrb_get_args(mrb, "&", &blk);
if (mrb_nil_p(blk)) {
mrb_raise(mrb, E_FIBER_ERROR, "tried to create Fiber object without a block");
mrb_raise(mrb, E_ARGUMENT_ERROR, "tried to create Fiber object without a block");
}
p = mrb_proc_ptr(blk);
if (MRB_PROC_CFUNC_P(p)) {
......
......@@ -110,3 +110,7 @@ assert('Root fiber resume') do
f.resume
assert_false f.alive?
end
assert('Fiber without block') do
assert_raise(ArgumentError) { Fiber.new }
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