summaryrefslogtreecommitdiff
path: root/spec/ruby/core/module
AgeCommit message (Collapse)Author
2020-11-13Update to ruby/spec@b0b7f53Benoit Daloze
2020-10-24Update to ruby/spec@4f59d86Benoit Daloze
2020-09-30Update to ruby/spec@bfd843aBenoit Daloze
2020-09-25Disable deprecation warning by the default [Feature #16345]Nobuyoshi Nakada
And `-w` option turns it on. Notes: Merged: https://github.com/ruby/ruby/pull/3481
2020-09-22Revert "Prevent SystemStackError when calling super in module with activated ↵Jeremy Evans
refinement" This reverts commit eeef16e190cdabc2ba474622720f8e3df7bac43b. This also reverts the spec change. Preventing the SystemStackError would be nice, but there is valid code that the fix breaks, and it is probably more common than cases that cause the SystemStackError. Fixes [Bug #17182] Notes: Merged: https://github.com/ruby/ruby/pull/3564
2020-09-152.8 -> 3.0 in specsBenoit Daloze
2020-09-02Fix constant names set using const_set on a singleton classMarc-Andre Lafortune
Fixes [Bug #14895] Notes: Merged: https://github.com/ruby/ruby/pull/3502
2020-08-28Update to ruby/spec@335eb9bBenoit Daloze
2020-07-27Update to ruby/spec@07164daBenoit Daloze
2020-06-27Update to ruby/spec@b6b7752Benoit Daloze
2020-06-03Ensure origins for all included, prepended, and refined modulesJeremy Evans
This fixes various issues when a module is included in or prepended to a module or class, and then refined, or refined and then included or prepended to a module or class. Implement by renaming ensure_origin to rb_ensure_origin, making it non-static, and calling it when refining a module. Fix Module#initialize_copy to handle origins correctly. Previously, Module#initialize_copy did not handle origins correctly. For example, this code: ```ruby module B; end class A def b; 2 end prepend B end a = A.dup.new class A def b; 1 end end p a.b ``` Printed 1 instead of 2. This is because the super chain for a.singleton_class was: ``` a.singleton_class A.dup B(iclass) B(iclass origin) A(origin) # not A.dup(origin) ``` The B iclasses would not be modified, so the includer entry would be still be set to A and not A.dup. This modifies things so that if the class/module has an origin, all iclasses between the class/module and the origin are duplicated and have the correct includer entry set, and the correct origin is created. This requires other changes to make sure all tests still pass: * rb_undef_methods_from doesn't automatically handle classes with origins, so pass it the origin for Comparable when undefing methods in Complex. This fixed a failure in the Complex tests. * When adding a method, the method cache was not cleared correctly if klass has an origin. Clear the method cache for the klass before switching to the origin of klass. This fixed failures in the autoload tests related to overridding require, without breaking the optimization tests. Also clear the method cache for both the module and origin when removing a method. * Module#include? is fixed to skip origin iclasses. * Refinements are fixed to use the origin class of the module that has an origin. * RCLASS_REFINED_BY_ANY is removed as it was only used in a single place and is no longer needed. * Marshal#dump is fixed to skip iclass origins. * rb_method_entry_make is fixed to handled overridden optimized methods for modules that have origins. Fixes [Bug #16852] Notes: Merged: https://github.com/ruby/ruby/pull/3140
2020-05-31Update to ruby/spec@4e486faBenoit Daloze
2020-05-03Update to ruby/spec@032ee74Benoit Daloze
2020-05-02Update to ruby/spec@d394dfdBenoit Daloze
2020-04-01Drop support for ruby 2.4 from ruby/specNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2892
2020-04-01Use FrozenError instead of frozen_error_classNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2892
2020-03-28Update to ruby/spec@ec84479Benoit Daloze
2020-02-28Update to ruby/spec@41bf282Benoit Daloze
2019-12-20Fixed misspellingsNobuyoshi Nakada
Fixed misspellings reported at [Bug #16437], only in ruby and rubyspec.
2019-11-30Update to ruby/spec@4eec3dcBenoit Daloze
2019-11-18Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans
This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby. Notes: Merged: https://github.com/ruby/ruby/pull/2476
2019-09-26[EXPERIMENTAL] Make Module#name return a frozen StringJean Boussier
* Always the same frozen String for a given Module or Class. * Avoids extra allocations whenever calling Module#name. * See [Feature #16150] Notes: Merged: https://github.com/ruby/ruby/pull/2487
2019-08-09Fix typo: duplicated the [skip-ci]ohbarye
2019-07-27Update to ruby/spec@875a09eBenoit Daloze
2019-06-27Update to ruby/spec@8d74d49Benoit Daloze
2019-06-21Use different names for autoload constants in specs for clarityBenoit Daloze
2019-06-21Add extra spec from https://github.com/ruby/ruby/pull/2173Jean Boussier
2019-06-21Add an optional `inherit` argument to Module#autoload?Jean Boussier
[Feature #15777] Closes: https://github.com/ruby/ruby/pull/2173
2019-05-28Update to ruby/spec@9a501a8Benoit Daloze
2019-05-22Eagerly name modules and classesAlan Wu
* variable.c: make the hidden ivars `classpath` and `tmp_classpath` the source of truth for module and constant names. Assign to them when modules are bind to constants. * variable.c: remove references to module name cache, as what used to be the cache is now the source of truth. Remove rb_class_path_no_cache(). * variable.c: remove the hidden ivar `classid`. This existed for the purposes of module name search, which is now replaced. Also, remove the associated rb_name_class(). * class.c: use rb_set_class_path_string to set the name of Object during boot. Must use a fstring as this runs before rb_cString is initialized and creating a normal string leads to a VALUE without a class. * spec/ruby/core/module/name_spec.rb: add a few specs to specify what happens to Module#name across multiple operations. These specs pass without other code changes in this commit. [Feature #15765]
2019-05-08Use ruby_bug guardNobuyoshi Nakada
2019-05-08Do not break rubyspec for old RubyTakashi Kokubun
Fixing 7d805e67f3275aef066d77aa9c32bef715c362ed
2019-05-07Avoid triggering autoload in Module#const_defined?(String)Jean Boussier
[Bug #15780]
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-02-21Update to ruby/spec@7a16e01eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-07Update to ruby/spec@6cf8ebeeregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-28Add refinements support to method/instance_method.nobu
[Fix GH-2034] From: manga_osyo <manga.osyo@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66935 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-12-29Update to ruby/spec@944ea57eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-27Update to ruby/spec@cdd6ff7eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-22Enable refinements at Object#respond_to?nobu
[Feature #15327] [Fix GH-2020] From: osyo-manga <manga.osyo@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-22Enable refinements to public_send.nobu
[Feature #15326] [Fix GH-2019] From: manga_osyo <manga.osyo@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-25Update to ruby/spec@241f9e7eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-27Update to ruby/spec@09fa86ceregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-03Update to ruby/spec@9be7c7eeregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-27Update to ruby/spec@a454137eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-28Update to ruby/spec@6f38a82eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-26Update to ruby/spec@a585ec3eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-12Fix setting method visibility on method wrapped with prependnobu
Ignore prepended modules when looking for already defined methods on a class to set the visibility on. [Fix GH-1834] From: Dylan Thacker-Smith <Dylan.Smith@shopify.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e