summaryrefslogtreecommitdiff
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* Fix spec failures on ruby 3.1Kazuhiro NISHIYAMA2022-01-151-1/+1
| | | | Because Module#const_added is ruby 3.2 feature
* Make Hash#shift return nil for empty hashJeremy Evans2022-01-141-10/+32
| | | | Fixes [Bug #16908]
* Fix constant assignment evaluation orderJeremy Evans2022-01-141-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the right hand side was always evaluated before the left hand side for constant assignments. For the following: ```ruby lhs::C = rhs ``` rhs was evaluated before lhs, which is inconsistant with attribute assignment (lhs.m = rhs), and apparently also does not conform to JIS 3017:2013 11.4.2.2.3. Fix this by changing evaluation order. Previously, the above compiled to: ``` 0000 putself ( 1)[Li] 0001 opt_send_without_block <calldata!mid:rhs, argc:0, FCALL|VCALL|ARGS_SIMPLE> 0003 dup 0004 putself 0005 opt_send_without_block <calldata!mid:lhs, argc:0, FCALL|VCALL|ARGS_SIMPLE> 0007 setconstant :C 0009 leave ``` After this change: ``` 0000 putself ( 1)[Li] 0001 opt_send_without_block <calldata!mid:lhs, argc:0, FCALL|VCALL|ARGS_SIMPLE> 0003 putself 0004 opt_send_without_block <calldata!mid:rhs, argc:0, FCALL|VCALL|ARGS_SIMPLE> 0006 swap 0007 topn 1 0009 swap 0010 setconstant :C 0012 leave ``` Note that if expr is not a module/class, then a TypeError is not raised until after the evaluation of rhs. This is because that error is raised by setconstant. If we wanted to raise TypeError before evaluation of rhs, we would have to add a VM instruction for calling vm_check_if_namespace. Changing assignment order for single assignments caused problems in the multiple assignment code, revealing that the issue also affected multiple assignment. Fix the multiple assignment code so left-to-right evaluation also works for constant assignments. Do some refactoring of the multiple assignment code to reduce duplication after adding support for constants. Rename struct masgn_attrasgn to masgn_lhs_node, since it now handles both constants and attributes. Add add_masgn_lhs_node static function for adding data for lhs attribute and constant setting. Fixes [Bug #15928]
* Add a Module#const_added callbackJean Boussier2022-01-141-0/+125
| | | | | | | | | | | | [Feature #17881] Works similarly to `method_added` but for constants. ```ruby Foo::BAR = 42 # call Foo.const_added(:FOO) class Foo::Baz; end # call Foo.const_added(:Baz) Foo.autoload(:Something, "path") # call Foo.const_added(:Something) ```
* [rubygems/rubygems] Use `Fiddle` in `bundle doctor` to check for dynamic ↵Vyacheslav Alexeev2022-01-131-3/+3
| | | | | | library presence https://github.com/rubygems/rubygems/commit/ecd495ce1b
* Update to ruby/spec@226cfdcBenoit Daloze2022-01-1042-84/+470
|
* Update to ruby/mspec@3ea3d32Benoit Daloze2022-01-102-2/+15
|
* Fix spec failure on ruby 3.1Kazuhiro NISHIYAMA2022-01-061-2/+2
| | | | | | | | | | | | | | | | Because https://github.com/ruby/ruby/pull/5148 merged after Ruby 3.1.0 released. 13241b71a50dded0a7b021ec4f2fb6a995daace9 did not fix proc spec yet. https://github.com/ruby/actions/runs/4718820699?check_suite_focus=true#step:18:173 ``` 1) 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)>' ```
* Remove Refinement#{extend_object,append_features,prepend_features}Jeremy Evans2022-01-053-0/+63
| | | | | | | Also make include, prepend, and extend raise a TypeError if one of the modules is a refinement. Implements [Feature #18270]
* Fix failures on ruby 3.1Kazuhiro NISHIYAMA2022-01-051-2/+2
| | | | | | | | | | | | | | | | | | | | | 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)>' ```
* [rubygems/rubygems] Test the actual checksums of the mock gemsNobuyoshi Nakada2022-01-041-0/+7
| | | | https://github.com/rubygems/rubygems/commit/2b42630959
* [rubygems/rubygems] Fix the test to use the mock gem pathNobuyoshi Nakada2022-01-041-3/+5
| | | | | | | "NUL.*" means the NUL device on Windows, as well as mere "NUL", and no data is read. https://github.com/rubygems/rubygems/commit/e2c7d22745
* [rubygems/rubygems] Append a newline to the checksum fileNobuyoshi Nakada2022-01-041-1/+1
| | | | https://github.com/rubygems/rubygems/commit/48ea2778e9
* [rubygems/rubygems] Fix checksumNobuyoshi Nakada2022-01-041-0/+6
| | | | | | | Calculate the checksum of the content, not the given pathname at the build time itself. https://github.com/rubygems/rubygems/commit/b60ee97ee9
* Kernel#=~: delete卜部昌平2022-01-032-16/+18
| | | | Has been deprecated since ebff9dc10e6e72239c23e50acc7d3cbfdc659e7a.
* Remove deprecated Random::DEFAULT [Feature #17351]Nobuyoshi Nakada2022-01-011-9/+11
|
* Remove unnecessary Random::DEFAULT expectationsNobuyoshi Nakada2022-01-011-22/+0
| | | | The respond_to expectation just suffice as duck-typing.
* Add support for anonymous rest and keyword rest argument forwardingJeremy Evans2021-12-302-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* [rubygems/rubygems] Better way to join path componentsDavid Rodríguez2021-12-301-1/+1
| | | | | | | The current way works, but error messages show duplicate "/" in paths, which is weird. https://github.com/rubygems/rubygems/commit/9123deb4fa
* s/an Bignum/a Bignum/ [ci skip]Nobuyoshi Nakada2021-12-283-5/+5
|
* Remove obsolete Fixnum and BignumNobuyoshi Nakada2021-12-281-15/+17
|
* Skip testing --enable-all in MinGW for nowTakashi Kokubun2021-12-271-1/+3
| | | | | | | | If we don't intend to support this platform, we should probably enable MJIT for MinGW. However, since the code for https://bugs.ruby-lang.org/issues/18439 is in place, I'm adjusting the test for it in the meantime. following up https://github.com/ruby/ruby/pull/5363
* [rubygems/rubygems] Fix `bundle update --bundler` no longer updating lockfileDavid Rodríguez2021-12-281-0/+35
| | | | https://github.com/rubygems/rubygems/commit/a053b7e4d4
* [rubygems/rubygems] Run `bundle install` in verbose modeDavid Rodríguez2021-12-271-1/+1
| | | | | | To see if we get more information when this fails. https://github.com/rubygems/rubygems/commit/853d33fdc3
* Track RubyGems 3.4.0dev and Bundler 2.4.0devHiroshi SHIBATA2021-12-275-62/+64
|
* [rubygems/rubygems] Don't add verbose flag so opaquely for realworld specsDavid Rodríguez2021-12-271-1/+0
| | | | https://github.com/rubygems/rubygems/commit/fa8455ef7c
* [rubygems/rubygems] Move setup to the spec that uses itDavid Rodríguez2021-12-271-9/+11
| | | | https://github.com/rubygems/rubygems/commit/7cf0a8fa8e
* [rubygems/rubygems] Remove unused includeDavid Rodríguez2021-12-271-2/+0
| | | | https://github.com/rubygems/rubygems/commit/a581a1dd50
* [rubygems/rubygems] Remove the rest of the `RUBY_VERSION` monkeypatchingDavid Rodríguez2021-12-272-18/+23
| | | | | | | Since we're at it. This generates a bunch of warnings and seems like a brittle way to test things, so let's get rid of it. https://github.com/rubygems/rubygems/commit/f5d45520e0
* [rubygems/rubygems] Update some specs to pass ruby-head CIDavid Rodríguez2021-12-272-34/+44
| | | | | | | | | | | | | | | These specs were monkeypatching `RUBY_VERSION`, but that obviously doesn't change the running ruby to behave any different. The removal of some features, in particular, `String#untaint`, made these specs fail, because untaint is no longer available under ruby-core and bundler calls `untaint` when `RUBY_VERSION` is less than "2.7", which these specs were overwriting it to be. Rewrite these specs to not overwrite `RUBY_VERSION`, but still test the same things. https://github.com/rubygems/rubygems/commit/e8c7b92901
* Postpone fix of lookbehind with ss characters tentativelyNobuyoshi Nakada2021-12-261-1/+1
|
* Remove Refinement#include and Refinement#prependNobuyoshi Nakada2021-12-261-17/+19
|
* Remove tainted and trusted featuresNobuyoshi Nakada2021-12-263-0/+12
| | | | Already these had been announced to be removed in 3.2.
* Merge RubyGems-3.3.3 and Bundler-2.3.3Hiroshi SHIBATA2021-12-251-0/+23
|
* Merge RubyGems-3.3.2 and Bundler-2.3.2Hiroshi SHIBATA2021-12-241-5/+2
|
* Merge RubyGems-3.3.1 and Bundler-2.3.1Hiroshi SHIBATA2021-12-2311-36/+30
|
* Reverts the accidental commits for rubygems/bundler.Hiroshi SHIBATA2021-12-221-22/+2
| | | | | | | | We stay to the stable version for releasing Ruby 3.1.0. Revert commits: b86a7ba49252e00e19c22bbcdc821b5acc31ff92 ef973aa7aa65143a4f05d623c016d459426770d0
* [rubygems/rubygems] Fix error when gem specified twice in gemfile under ↵David Rodríguez2021-12-221-0/+16
| | | | | | different platforms https://github.com/rubygems/rubygems/commit/83bc87ca98
* [rubygems/rubygems] These commands shouldn't be failing, just warningDavid Rodríguez2021-12-221-2/+6
| | | | https://github.com/rubygems/rubygems/commit/04b1ac72b9
* Merge RubyGems-3.3.0 and Bundler-2.3.0Hiroshi SHIBATA2021-12-219-125/+163
|
* [rubygems/rubygems] Print warning when running potentially problematic ↵David Rodríguez2021-12-211-0/+1
| | | | | | | | rubygems + ruby combinations https://github.com/rubygems/rubygems/commit/d6df0b7de0 Co-authored-by: André Arko <andre@arko.net>
* [rubygems/rubygems] Rename `BUNDLE_SPEC_RUN` environment variableDavid Rodríguez2021-12-212-9/+9
| | | | | | | | The `BUNDLE_` prefix should be reserved to first class settings that should be listed when running `bundle config`. This one is just a hacky environment variable that has not corresponding documented setting. https://github.com/rubygems/rubygems/commit/7e255c5058
* Remove Class#descendantsJeremy Evans2021-12-201-38/+0
|
* [rubygems/rubygems] Error tracing should be printed to stderrDavid Rodríguez2021-12-202-2/+6
| | | | https://github.com/rubygems/rubygems/commit/23178f7d7b
* skip -v spec on MJITKoichi Sasada2021-12-191-1/+2
| | | | | | | | | | | | | | | | | | | | | fix this failure: ``` configure ... cppflags=-DMJIT_FORCE_ENABLE ... make test-spec 1) The -v command line option when used alone prints version and ends FAILED Expected "ruby 3.1.0dev (2021-12-18T10:10:42Z master 78c175280b) +MJIT [x86_64-linux] " to include "ruby 3.1.0dev (2021-12-18T10:10:42Z master 78c175280b) [x86_64-linux]" /tmp/ruby/v3/src/trunk-mjit-wait/spec/ruby/command_line/dash_v_spec.rb:9:in `block (3 levels) in <top (required)>' /tmp/ruby/v3/src/trunk-mjit-wait/spec/ruby/command_line/dash_v_spec.rb:4:in `<top (required)>' ``` http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3759943
* [rubygems/rubygems] Improve errors a bit moreDavid Rodríguez2021-12-173-9/+24
| | | | https://github.com/rubygems/rubygems/commit/f481e8f41a
* [rubygems/rubygems] Share gem not found logic with transitive dependencies tooDavid Rodríguez2021-12-171-0/+21
| | | | https://github.com/rubygems/rubygems/commit/e4a1a9663d
* [rubygems/rubygems] Fix crash when no matching variants are found for the ↵David Rodríguez2021-12-171-0/+20
| | | | | | | | | | current platform If we are resolving a dependency against a particular platform, and there are no platform specific variants of the candidates that match that platform, we should not consider those candidates. https://github.com/rubygems/rubygems/commit/f6077fe27d
* [rubygems/rubygems] Improve resolver error messagesDavid Rodríguez2021-12-172-5/+5
| | | | | | Use a more standard naming for gems. https://github.com/rubygems/rubygems/commit/75121e83f1
* Restore the global random seedNobuyoshi Nakada2021-12-161-0/+8
|