зеркало из https://github.com/github/ruby.git
Make boolean expected messages more consitent
This commit is contained in:
Родитель
9b972310fa
Коммит
8a6ef5ef8f
3
error.c
3
error.c
|
@ -1271,8 +1271,7 @@ exc_full_message(int argc, VALUE *argv, VALUE exc)
|
|||
rb_get_kwargs(opt, kw, 0, kw_max_, args);
|
||||
switch (args[kw_highlight]) {
|
||||
default:
|
||||
rb_raise(rb_eArgError, "expected true or false as "
|
||||
"highlight: %+"PRIsVALUE, args[kw_highlight]);
|
||||
rb_bool_expected(args[kw_highlight], "highlight");
|
||||
case Qundef: args[kw_highlight] = Qnil; break;
|
||||
case Qtrue: case Qfalse: case Qnil: break;
|
||||
}
|
||||
|
|
2
object.c
2
object.c
|
@ -3388,7 +3388,7 @@ rb_bool_expected(VALUE obj, const char *flagname)
|
|||
case Qtrue: case Qfalse:
|
||||
break;
|
||||
default:
|
||||
rb_raise(rb_eArgError, "true or false is expected as %s: %+"PRIsVALUE,
|
||||
rb_raise(rb_eArgError, "expected true or false as %s: %+"PRIsVALUE,
|
||||
flagname, obj);
|
||||
}
|
||||
return obj != Qfalse;
|
||||
|
|
Загрузка…
Ссылка в новой задаче