diff options
Diffstat (limited to 'spec/ruby/optional/capi/ext/util_spec.c')
-rw-r--r-- | spec/ruby/optional/capi/ext/util_spec.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/ruby/optional/capi/ext/util_spec.c b/spec/ruby/optional/capi/ext/util_spec.c index 50a5fcb095..e579b5e0af 100644 --- a/spec/ruby/optional/capi/ext/util_spec.c +++ b/spec/ruby/optional/capi/ext/util_spec.c @@ -16,7 +16,14 @@ VALUE util_spec_rb_scan_args(VALUE self, VALUE argv, VALUE fmt, VALUE expected, args[i] = rb_ary_entry(argv, i); } - result = rb_scan_args(argc, args, RSTRING_PTR(fmt), &a1, &a2, &a3, &a4, &a5, &a6); + if (*RSTRING_PTR(fmt) == 'k') { +#ifdef RB_SCAN_ARGS_KEYWORDS + result = rb_scan_args_kw(RB_SCAN_ARGS_KEYWORDS, argc, args, RSTRING_PTR(fmt)+1, &a1, &a2, &a3, &a4, &a5, &a6); +#endif + } + else { + result = rb_scan_args(argc, args, RSTRING_PTR(fmt), &a1, &a2, &a3, &a4, &a5, &a6); + } switch(NUM2INT(expected)) { case 6: |