8 Commits

Author SHA1 Message Date
dearblue 668b12e756 Check more MRB_ARGS_NONE()
The `__id__` method implemented in the C function has `MRB_ARGS_NONE()` specified, but it is also effective in the following cases.

```ruby
p nil.__id__ opts: 1 rescue p :a
p nil.method(:__id__).call 1 rescue p :b
p nil.method(:__id__).call opts: 1 rescue p :c
p nil.method(:__id__).to_proc.call 1 rescue p :d
p nil.method(:__id__).to_proc.call opts: 1 rescue p :e
p nil.method(:__id__).unbind.bind_call nil, 1 rescue p :f
p nil.method(:__id__).unbind.bind_call nil, opts: 1 rescue p :g
p nil.__send__ :__id__, 1 rescue p :h
p nil.__send__ :__id__, opts: 1 rescue p :i
```

After applying this patch, all items will output symbols in the same way as CRuby.

For this purpose, add `MRB_PROC_NOARG` to `struct RProc::flags`.
2021-11-26 12:18:41 +09:00
KOBAYASHI Shuji 1a9ac02d8d Refine "wrong number of arguments" message in mrb_get_args
#### Before this patch:

```ruby
__send__         #=> wrong number of arguments
{}.default(1,2)  #=> wrong number of arguments
```

#### After this patch:

```ruby
__send__         #=> wrong number of arguments (given 0, expected 1+)
{}.default(1,2)  #=> wrong number of arguments (given 2, expected 0..1)
```
2021-01-02 19:15:34 +09:00
take_cheeze ec5b055694 Move direct superclass checking to test/t/superclass.rb. 2014-06-15 15:02:21 +09:00
Daniel Bovensiepen 11c4c65bf2 Fix order of actual and expect test value for ArgumentError 2013-08-01 15:12:41 +08:00
Daniel Bovensiepen dca23f6c5f Improve ArgumentError tests 2013-06-09 04:08:05 +08:00
Daniel Bovensiepen c78dc2930c Add superclass tests for Exceptions 2012-06-03 23:31:17 +08:00
Daniel Bovensiepen 31e9705022 Add Test cases for Literals, Enumeration, Exceptions and clean line endings 2012-05-29 01:20:46 +08:00
Daniel Bovensiepen 150b235fb6 Add Tests for all Exception classes, for false, true, Proc, Module, nil and Object 2012-05-25 14:01:14 +08:00