summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/downcase_spec.rb
AgeCommit message (Collapse)Author
2020-11-20Make String methods return String instances when called on a subclass instanceJeremy Evans
This modifies the following String methods to return String instances instead of subclass instances: * String#* * String#capitalize * String#center * String#chomp * String#chop * String#delete * String#delete_prefix * String#delete_suffix * String#downcase * String#dump * String#each/#each_line * String#gsub * String#ljust * String#lstrip * String#partition * String#reverse * String#rjust * String#rpartition * String#rstrip * String#scrub * String#slice! * String#slice/#[] * String#split * String#squeeze * String#strip * String#sub * String#succ/#next * String#swapcase * String#tr * String#tr_s * String#upcase This also fixes a bug in String#swapcase where it would return the receiver instead of a copy of the receiver if the receiver was the empty string. Some string methods were left to return subclass instances: * String#+@ * String#-@ Both of these methods will return the receiver (subclass instance) in some cases, so it is best to keep the returned class consistent. Fixes [#10845] Notes: Merged: https://github.com/ruby/ruby/pull/3701
2020-05-03Update to ruby/spec@032ee74Benoit Daloze
2020-04-01Use FrozenError instead of frozen_error_classNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2892
2020-01-28Update to ruby/spec@f8a2d54Benoit 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-07-27Update to ruby/spec@875a09eBenoit Daloze
2019-04-28Update to ruby/spec@7de852dBenoit Daloze
2019-04-27Update to ruby/spec@15c9619Benoit Daloze
2018-06-13Update to ruby/spec@4bb0f25eregon
* Specs added by TruffleRuby. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63654 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
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-10-28Update to ruby/spec@a6b8805eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60525 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