summaryrefslogtreecommitdiff
path: root/spec/ruby/core/method
AgeCommit message (Collapse)Author
2024-03-14Update to ruby/spec@89175b2Benoit Daloze
2024-02-26Update to ruby/spec@3a510bbBenoit Daloze
2024-02-12proc.c: get rid of `CLONESETUP`Jean Boussier
[Bug #20253] All the way down to Ruby 1.9, `Proc`, `Method`, `UnboundMethod` and `Binding` always had their own specific clone and dup routine. This caused various discrepancies with how other objects behave on `dup` and `clone. [Bug #20250], [Bug #20253]. This commit get rid of `CLONESETUP` and use the the same codepath as all other types, so ensure consistency. NB: It's still not accepting the `freeze` keyword argument on `clone`. Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
2023-11-27Update to ruby/spec@c3206f6Benoit Daloze
2023-10-30Update to ruby/spec@bd7017fBenoit Daloze
2023-09-04Update to ruby/spec@96d1072Benoit Daloze
2023-06-26Update to ruby/spec@30e1c35Benoit Daloze
2023-05-29Update to ruby/spec@c3677cfBenoit Daloze
2023-04-25Update to ruby/spec@7f69c86Benoit Daloze
2022-12-03UnboundMethod only refer defined_classKoichi Sasada
UnboundMethod records caller's class, like `D` or `E` on the following case: ```ruby class C def foo = :foo end class D < C end class E < C end d = D.instance_method(:foo) e = E.instance_method(:foo) ``` But `d` and `e` only refers `C#foo` so that UnboundMethod doesn't record `D` or `E`. This behavior changes the following methods: * `UnboundMethod#inspect` (doesn't show caller's class) * `UnboundMethod#==` (`d == e` for example) fix https://bugs.ruby-lang.org/issues/18798 Notes: Merged: https://github.com/ruby/ruby/pull/6855
2022-11-07Update to ruby/spec@740ccc8Benoit Daloze
2022-09-29Add specs for {Method,UnboundMethod}#owner of a zsuper methodBenoit Daloze
Notes: Merged: https://github.com/ruby/ruby/pull/6467
2022-09-29Fix {Method,UnboundMethod}#super_method for zsuper methodsBenoit Daloze
* We need to resolve the zsuper method first, and then look the super method of that. Notes: Merged: https://github.com/ruby/ruby/pull/6467
2022-09-28Update to ruby/spec@1d9d5c6Benoit Daloze
2022-04-25Update to ruby/spec@3affe1eBenoit Daloze
2022-01-05Fix failures on ruby 3.1Kazuhiro NISHIYAMA
Because https://github.com/ruby/ruby/pull/5148 merged after Ruby 3.1.0 released. https://github.com/ruby/actions/runs/4705986643?check_suite_focus=true#step:18:144 ``` 1) Method#parameters adds * rest arg for "star" argument FAILED Expected [[:rest]] == [[:rest, :*]] to be truthy but was false /home/runner/work/actions/actions/snapshot-ruby_3_1/spec/ruby/core/method/parameters_spec.rb:228:in `block (3 levels) in <top (required)>' /home/runner/work/actions/actions/snapshot-ruby_3_1/spec/ruby/core/method/parameters_spec.rb:4:in `<top (required)>' 2) Proc#parameters adds * rest arg for "star" argument FAILED Expected [[:req, :x], [:rest]] == [[:req, :x], [:rest, :*]] to be truthy but was false /home/runner/work/actions/actions/snapshot-ruby_3_1/spec/ruby/core/proc/parameters_spec.rb:85:in `block (3 levels) in <top (required)>' /home/runner/work/actions/actions/snapshot-ruby_3_1/spec/ruby/core/proc/parameters_spec.rb:3:in `<top (required)>' ```
2021-12-30Add support for anonymous rest and keyword rest argument forwardingJeremy Evans
This allows for the following syntax: ```ruby def foo(*) bar(*) end def baz(**) quux(**) end ``` This is a natural addition after the introduction of anonymous block forwarding. Anonymous rest and keyword rest arguments were already supported in method parameters, this just allows them to be used as arguments to other methods. The same advantages of anonymous block forwarding apply to rest and keyword rest argument forwarding. This has some minor changes to #parameters output. Now, instead of `[:rest], [:keyrest]`, you get `[:rest, :*], [:keyrest, :**]`. These were already used for `...` forwarding, so I think it makes it more consistent to include them in other cases. If we want to use `[:rest], [:keyrest]` in both cases, that is also possible. I don't think the previous behavior of `[:rest], [:keyrest]` in the non-... case and `[:rest, :*], [:keyrest, :**]` in the ... case makes sense, but if we did want that behavior, we'll have to make more substantial changes, such as using a different ID in the ... forwarding case. Implements [Feature #18351] Notes: Merged: https://github.com/ruby/ruby/pull/5148
2021-07-29Update to ruby/spec@b65d01fBenoit Daloze
2020-12-27Update to ruby/spec@4ce9f41Benoit Daloze
2020-12-23Fix class of method in Method#inspect for singleton classes of classesJeremy Evans
Previously, due to a change to fix bug 15608, Method#inspect output changed for class methods: Ruby 2.7 "#<Method: String.prepend(*)>" Before change: "#<Method: #<Class:Object>(Module)#prepend(*)>" This is wrong because the Method object was created from String and not Object. This is because the fix for bug 15608 assumed it was being called on the singleton class of a instance, and would skip the first singleton class until it got to the class itself. For class methods, this results in always using the superclass. Fix behavior to not skip until the superclass if the singleton class is the singleton class of a module or class. After change: "#<Method: #<Class:Object>(Module)#prepend(*)>" Fixes [Bug #17428] Notes: Merged: https://github.com/ruby/ruby/pull/3984
2020-12-21Use Integer instead of Fixnum/BignumNobuyoshi Nakada
2020-10-24Update to ruby/spec@4f59d86Benoit Daloze
2020-09-152.8 -> 3.0 in specsBenoit Daloze
2020-05-03Update to ruby/spec@032ee74Benoit Daloze
2020-04-01Drop support for ruby 2.4 from ruby/specNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2892
2020-03-09Don't display singleton class in Method#inspect unless method defined thereJeremy Evans
Previously, if an object has a singleton class, and you call Object#method on the object, the resulting string would include the object's singleton class, even though the method was not defined in the singleton class. Change this so the we only show the singleton class if the method is defined in the singleton class. Fixes [Bug #15608] Notes: Merged: https://github.com/ruby/ruby/pull/2949 Merged-By: jeremyevans <code@jeremyevans.net>
2019-12-30Decide lambdaness of (f << g) using g (#2729)Alan Wu
* Deciding lambdaness of (f << g) using g * Use version guards for spec changes Notes: Merged-By: XrXr
2019-09-29Update to ruby/spec@519df35Benoit Daloze
2019-07-27Update to ruby/spec@875a09eBenoit Daloze
2019-06-27Update to ruby/spec@8d74d49Benoit Daloze
2019-04-27Update to ruby/spec@15c9619Benoit Daloze
2019-03-28Update to ruby/spec@e81b3cderegon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-20Update to ruby/spec@35a9fbaeregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-31use requrie_relativenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-05required paths are real pathsnobu
Fix `test-spec` failures when the build directory is a symbolic link. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-04Update to ruby/spec@c1b568beregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-29Update to ruby/spec@83063a3eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-27Update to ruby/spec@0fe33aceregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-20Move spec/rubyspec to spec/ruby for consistencyeregon
* Other ruby implementations use the spec/ruby directory. [Misc #13792] [ruby-core:82287] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e