summaryrefslogtreecommitdiff
path: root/spec
AgeCommit message (Collapse)Author
2020-06-29Avoid deprecated OpenSSL::Digest constantsBart de Water
Notes: Merged: https://github.com/ruby/ruby/pull/3270
2020-06-27Update to ruby/spec@6c466d4Benoit Daloze
2020-06-27Update to ruby/spec@b6b7752Benoit Daloze
2020-06-27Update to ruby/mspec@6cb1f10Benoit Daloze
2020-06-19Implement Proc#== and #eql?Jeremy Evans
Previously, these were not implemented, and Object#== and #eql? were used. This tries to check the proc internals to make sure that procs created from separate blocks are treated as not equal, but procs created from the same block are treated as equal, even when the lazy proc allocation optimization is used. Implements [Feature #14267] Notes: Merged: https://github.com/ruby/ruby/pull/3174
2020-06-18Dup splat array in certain cases where there is a block argumentJeremy Evans
This makes: ```ruby args = [1, 2, -> {}]; foo(*args, &args.pop) ``` call `foo` with 1, 2, and the lambda, in addition to passing the lambda as a block. This is different from the previous behavior, which passed the lambda as a block but not as a regular argument, which goes against the expected left-to-right evaluation order. This is how Ruby already compiled arguments if using leading arguments, trailing arguments, or keywords in the same call. This works by disabling the optimization that skipped duplicating the array during the splat (splatarray instruction argument switches from false to true). In the above example, the splat call duplicates the array. I've tested and cases where a local variable or symbol are used do not duplicate the array, so I don't expect this to decrease the performance of most Ruby programs. However, programs such as: ```ruby foo(*args, &bar) ``` could see a decrease in performance, if `bar` is a method call and not a local variable. This is not a perfect solution, there are ways to get around this: ```ruby args = Struct.new(:a).new([:x, :y]) def args.to_a; a; end def args.to_proc; a.pop; ->{}; end foo(*args, &args) # calls foo with 1 argument (:x) # not 2 arguments (:x and :y) ``` A perfect solution would require completely disabling the optimization. Fixes [Bug #16504] Fixes [Bug #16500] Notes: Merged: https://github.com/ruby/ruby/pull/3157
2020-06-18[rubygems/rubygems] Make sure to pass URI's to `:git`David Rodríguez
Passing paths should work in most cases, but on Windows the driver letter is interpreted as the scheme and causes some case mismatches because ``` irb> URI.parse("E:").to_s => "e:" ``` We fix this by passing file URI's instead. https://github.com/rubygems/rubygems/commit/b6bc517628 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Better skip messagesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/4f519638ae Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] More portable PATH editionDavid Rodríguez
https://github.com/rubygems/rubygems/commit/a6d50afad0 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Only add .rubocop.yml when --rubocop flag is passedUtkarsh Gupta
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org> https://github.com/rubygems/rubygems/commit/ef2dae4222 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18Ship default .rubocop.ymlUtkarsh Gupta
Currently, there is no `.rubocop.yml` shipped by default. So when a user runs `rubocop` after creating a new gem via `bundle gem foo`, it throws a bunch of offenses. With the default `.rubocop.yml` present, the number of those offenses significantly reduce by 25. Signed-off-by: Utkarsh Gupta <utkarsh@debian.org> Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Only add .rubocop.yml when --rubocop flag is passedUtkarsh Gupta
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org> https://github.com/rubygems/rubygems/commit/ef2dae4222 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18Undeprecate the `--no-cache` flagDavid Rodríguez
This is not a remembered option, so it shouldn't have been deprecated. At least not for that reason. Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18s/sys_exec!/sys_execDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Remove now unused "bang helpers"David Rodríguez
https://github.com/rubygems/rubygems/commit/84e4c58e83 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] s/run!/runDavid Rodríguez
https://github.com/rubygems/rubygems/commit/e3f60d8aec Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] s/ruby!/rubyDavid Rodríguez
https://github.com/rubygems/rubygems/commit/a73fa0760e Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] s/gem_command!/gem_commandDavid Rodríguez
https://github.com/rubygems/rubygems/commit/f52733f6a4 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] s/install_gemfile!/install_gemfileDavid Rodríguez
https://github.com/rubygems/rubygems/commit/4d1a0c465a Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] s/bundle!/bundleDavid Rodríguez
https://github.com/rubygems/rubygems/commit/746a4b3d74 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Prefer using bundle! to avoid unnecessary swallowing of ↵Frank Lam
errors https://github.com/rubygems/rubygems/commit/6bac832a58 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Move already configured --test hint to before test file ↵Frank Lam
creation https://github.com/rubygems/rubygems/commit/9e5f7a9099 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Move already configured --ci hint to before CI file creationFrank Lam
https://github.com/rubygems/rubygems/commit/2af2abe5fd Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Lower verboseness of user-facing text for bundle gemFrank Lam
https://github.com/rubygems/rubygems/commit/288f073c3c Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Make test framework/CI configuration for bundle gem ↵Frank Lam
consistent * Add hints for --ci option https://github.com/rubygems/rubygems/commit/5f779f45b0 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Set CI global config to false in gem_helper_specFrank Lam
https://github.com/rubygems/rubygems/commit/39b18fe7fc Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Fix CI spec typoFrank Lam
Co-authored-by: Olle Jonsson <olle.jonsson@gmail.com> https://github.com/rubygems/rubygems/commit/24f3739585 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Incorporate naming/grammar suggestions from olleolleolleFrank Lam
https://github.com/rubygems/rubygems/commit/80571452ca Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Move CI specs below test framework specsFrank Lam
https://github.com/rubygems/rubygems/commit/d8e416d89b Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Remove shared examples for present test frameworkFrank Lam
* `bundle gem` has new option to select CI provider https://github.com/rubygems/rubygems/commit/320f3546c1 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Separate CI and test framework shared examplesFrank Lam
* `bundle gem` has new option to choose CI provider other than Travis CI https://github.com/rubygems/rubygems/commit/afaecf16de Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Extract shared example for absence of CI filesFrank Lam
https://github.com/rubygems/rubygems/commit/22cb599bcc Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18Manually cherry-picked at ↵Hiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/80260b3496e357bf96ffe6f381e29bf25b6749cb Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Remove unnecessary `bundle install`David Rodríguez
These specs doesn't really need an installed bundle, they only need a `Gemfile`. https://github.com/rubygems/rubygems/commit/06c85683ae Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Make helpers raise by defaultDavid Rodríguez
https://github.com/rubygems/rubygems/commit/ade0c441d5 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Fix a couple of specs that were loading an incorrect bundlerDavid Rodríguez
We have a check on an `at_exit` hook that checks that system bundler is never loaded instead of our development copy. The check was failing in these cases, but in a silent way because the errors were being swallowed. This commit changes these specs to make sure they load the right bundler. https://github.com/rubygems/rubygems/commit/cd1c1bc297 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Change spec to do the right thing on bundler 3David Rodríguez
On bundler 3, the `--deployment` flag doesn't exist, so the `bundle install --deployment` command was failing silently and the spec was verifying a different scenario. Change the spec to work the same regardless of bundler's major version. Also, from the spec description it was not apparently that a specific case involving deployment mode was being tested, so I reworded it to make it more apparent. https://github.com/rubygems/rubygems/commit/3e33e2b927 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Fix some sudo specs to do the right thing on bundler 3David Rodríguez
On bundler 3, where the default install path is `.bundle`, these specs were trying to change permissions of the `.bundle/ruby/<ruby_abi_version>` folder, which didn't exist yet,so the permission changing command was failing and the spec was not testing the right thing. Change the specs so that the permissions are correctly changed, by first configuring the local path to be `.bundle` (which creates the `.bundle` folder), and then changing permissions of the `.bundle` folder explicitly, which exists already. https://github.com/rubygems/rubygems/commit/2833162fb0 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Fix spec to test the right thing on bundler 3David Rodríguez
Bundler 3 installs by default to `.bundle`. That means that, because the `bar` gem was not previously available at this location but as a system gem, the initial `bundle install` was silently failing. As a consequence, the spec was not testing the exact scenario it meant to test. https://github.com/rubygems/rubygems/commit/202399521c Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Remove bad `bundle install`David Rodríguez
This spec is specifically testing for the case where there's no `Gemfile.lock` file and it's only doing the expected thing because the `bundle install` command is silently failing. Remove the `bundle install` to reduce confusion. https://github.com/rubygems/rubygems/commit/ec39fbde0e Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Simplify `bundle update --ruby` specsDavid Rodríguez
They don't need to run that many commands, and the new version is also more readable in my opinion. https://github.com/rubygems/rubygems/commit/efff3e3210 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Fix redundant commandsDavid Rodríguez
They are preceded by `install_gemfile` calls, which mean `bundle install` is being run twice for no reason. https://github.com/rubygems/rubygems/commit/d2b2d10862 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Fix unintended Gemfile installationDavid Rodríguez
This command is failing because of the same reason that the subsequent `bundle exec` is failing: the gemspec is invalid. The `bundle install` here deviates the `bundle exec` focus from the test and is unnecessary: all we need is a `Gemfile` that will trigger the `bundle exec`, so let's create and avoid the extra command. https://github.com/rubygems/rubygems/commit/eb83cf6cf1 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Remove failing command that doesn't affect the specDavid Rodríguez
This command was silently failing but doesn't really affect the outcome of the spec. https://github.com/rubygems/rubygems/commit/7880d08146 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Remove broken testDavid Rodríguez
It turns out that this test is checking essentially nothing useful. The paperclip gem doesn't exist in our setup, so initial install is failing and the test is only checking that calling `bundle check` 3 times on a broken setup always returns the same thing. I went to the history of this test: * https://github.com/rubygems/bundler/commit/105654a31e07e9b0a198f1a5a5ec94e365854edf * https://github.com/rubygems/bundler/commit/ae53be1f8748bfc41bc6565dc4922a1c0ac80998 * https://github.com/rubygems/bundler/commit/d19f4a7b32ccf4ec4ecda5c7c0354adc81e1efb6 * https://github.com/rubygems/bundler/commit/092f169d01472336598e29b32550399991940d63 * https://github.com/rubygems/bundler/commit/36878435b5f0be75fc6f2e07cebd7f15aaddadf0 And have finally decided to remove it since I'm not sure changing it to something else will lead to testing something useful and not already tested. https://github.com/rubygems/rubygems/commit/6184322967 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Fix silently broken specDavid Rodríguez
This spec was broken. The second `bundle install` was silently failing. This means that the spec was actually checking an scenario completely different from the one that was supposed to be tested. And also a very dummy one: that running `bundle cache` twice doesn't cache a completely unrelated gem. https://github.com/rubygems/rubygems/commit/f11a5d2df9 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Remove incorrect tagsDavid Rodríguez
The inner specs have separated specs for the `< 3` and `= 2` cases, so this outer tag is incorrect. https://github.com/rubygems/rubygems/commit/61e905ca27 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Migrate some specs to use "the new way"David Rodríguez
The commands these specs run were throwing warnings in bundler 2, and failing on bundler 3, effectively testing a different scenario to what they were supposed to. https://github.com/rubygems/rubygems/commit/97ac1ced49 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] s/rails_fail/rails_pinned_to_old_activesupport/David Rodríguez
The `rails_fail` name is misleading because there's no specific reason why such a gem would need to fail. As a matter of fact, `bundle install`'ing a Genfile with only that dependency like the spec the previous commit adds is not expected to fail. https://github.com/rubygems/rubygems/commit/b947f40701 Notes: Merged: https://github.com/ruby/ruby/pull/3212
2020-06-18[rubygems/rubygems] Fix `only_update_to_newer_versions` regressionDavid Rodríguez
The `only_update_to_newer_versions` feature flag will enable some new behaviour in bundler 3 (or maybe earlier if we decide to consider it a bug fix) that prevents `bundle update` from unexpectedly downgrading direct dependencies. This seems reasonable, but the current implementation is adding additional requirements for all locked dependencies, not only from the ones in the `Gemfile`. That causes some situations where the `Gemfile` is edited and will resolve to older versions to start failing. This commit fixes the problem by making sure extra requirements are added exclusively for direct dependencies in the `Gemfile`, not for all direct dependencies in the lock file. https://github.com/rubygems/rubygems/commit/128b4596e1 Notes: Merged: https://github.com/ruby/ruby/pull/3212