aboutsummaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* [rubygems/rubygems] Migrate documentation to be generated with nronnDavid Rodríguez2023-12-081-2/+2
| | | | https://github.com/rubygems/rubygems/commit/55281f0eaa
* [rubygems/rubygems] Extract generate_index command to ↵Samuel Giddins2023-12-083-12/+17
| | | | | | | | | | | | | | | | rubygems-generate_index gem So generate_index can be implemented with dependencies, such as the compact index Took this approach from feedback in https://github.com/rubygems/rubygems/pull/6853 Running `gem generate_index` by default will use an installed rubygems-generate_index, or install and then use the command from the gem Apply suggestions from code review https://github.com/rubygems/rubygems/commit/fc1cb9bc9e Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
* [rubygems/rubygems] Use `Minitest::TestTask` in a template file for `minitest`Yuji Yaginuma2023-12-081-6/+2
| | | | | | | | | | | | | `minitest` has introduced a rake task for running test on 5.16.0. https://github.com/minitest/minitest/blob/master/History.rdoc#5160--2022-06-14- This has some tasks related to running tests and it's useful for `minitest` user I think. https://github.com/minitest/minitest#rake-tasks- This PR changed to use the task in a template file for `minitest` https://github.com/rubygems/rubygems/commit/7a86d13062
* [rubygems/rubygems] Use modern hashes consistentlyDavid Rodríguez2023-12-07137-1964/+1964
| | | | https://github.com/rubygems/rubygems/commit/bb66253f2c
* Fix keyword splat passing as regular argumentJeremy Evans2023-12-073-15/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Ruby 3.0, Ruby has passed a keyword splat as a regular argument in the case of a call to a Ruby method where the method does not accept keyword arguments, if the method call does not contain an argument splat: ```ruby def self.f(obj) obj end def self.fs(*obj) obj[0] end h = {a: 1} f(**h).equal?(h) # Before: true; After: false fs(**h).equal?(h) # Before: true; After: false a = [] f(*a, **h).equal?(h) # Before and After: false fs(*a, **h).equal?(h) # Before and After: false ``` The fact that the behavior differs when passing an empty argument splat makes it obvious that something is not working the way it is intended. Ruby 2 always copied the keyword splat hash, and that is the expected behavior in Ruby 3. This bug is because of a missed check in setup_parameters_complex. If the keyword splat passed is not mutable, then it points to an existing object and not a new object, and therefore it must be copied. Now, there are 3 specs for the broken behavior of directly using the keyword splatted hash. Fix two specs and add a new version guard. Do not keep the specs for the broken behavior for earlier Ruby versions, in case this fix is backported. For the ruby2_keywords spec, just remove the related line, since that line is unrelated to what the spec is testing. Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
* [rubygems/rubygems] Bundler::Fetcher uses Bundler::CIDetectorEric Mueller2023-12-061-6/+8
| | | | | | | | | | Additionally, the result is memoized, as it's used twice in a row. This change does result in a net behavioral diff, as the list of ENVs being checked has been updated (now includes buildkite, taskcluster, cirrus, dsari, and drops buildbox and snap) https://github.com/rubygems/rubygems/commit/3fb445a5a1
* [rubygems/rubygems] Duplicate Gem::CIDetector into bundlerEric Mueller2023-12-061-0/+21
| | | | | | | | | | | Because bundler needs to support older versions of rubygems, we can't actually rely on Gem::CIDetector (yet - in a year or so they might be able to consolidate, if they don't change futher). So we're copying it into the Bundler:: namespace, and enforcing that they stay completely in sync with a test. No other tests are needed, since Gem::CIDetector is already tested, and this is and will remain identical. https://github.com/rubygems/rubygems/commit/abc67f0da1
* [rubygems/rubygems] Converts Bundler lockfile checksum validation to opt-in onlyMartin Emde2023-12-0522-810/+837
| | | | | | | | | Looks for the CHECKSUMS section in the lockfile, activating the feature only if the section exists. Without a CHECKSUMS section, Bundler will continue as normal, validating checksums when gems are installed while checksums from the compact index are present. https://github.com/rubygems/rubygems/commit/2353cc93a4
* [ruby/syntax_suggest] Change assertion to not rely on exact text from prismSchneems2023-12-051-5/+1
| | | | | | | | The original ripper test was very stable as the output didn't change. Prism is under active development and changing their output shouldn't cause a failure to the ruby/ruby test suite like https://github.com/ruby/ruby/actions/runs/7104601478/job/19339940315. This commit moves from checking exact output to asserting that the string we get back is not empty. This should give the same level of confidence that some error message was caught, and is less brittle. https://github.com/ruby/syntax_suggest/commit/4b6abb763e
* [ruby/syntax_suggest] Update docs, clean up PRSchneems2023-12-051-3/+0
| | | | | | Removes or updates mentions of Ripper https://github.com/ruby/syntax_suggest/commit/08aaa3f50a
* [ruby/syntax_suggest] Support lexing with PrismSchneems2023-12-051-0/+6
| | | | https://github.com/ruby/syntax_suggest/commit/7f4176a914
* [ruby/syntax_suggest] Initial support for the prism parserSchneems2023-12-051-2/+6
| | | | | | | | | | | | | | Prism will be the parser in Ruby 3.3. We need to support 3.0+ so we will have to "dual boot" both parsers. Todo: - LexAll to support Prism lex output - Add tests that exercise both Ripper and prism codepaths on CI - Handle https://github.com/ruby/prism/issues/1972 in `ripper_errors.rb` - Update docs to not mention Ripper explicitly - Consider different/cleaner APIs for separating out Ripper and Prism https://github.com/ruby/syntax_suggest/commit/a7d6991cc4
* [rubygems/rubygems] Fix crash when duplicating a dev dependency in Gemfile & ↵David Rodríguez2023-12-051-0/+35
| | | | | | gemspec https://github.com/rubygems/rubygems/commit/e78c0a4a48
* [ruby/syntax_suggest] Bump minimum Ruby version & update standardrbSchneems2023-12-0411-84/+84
| | | | https://github.com/ruby/syntax_suggest/commit/73753518e9
* [ruby/syntax_suggest] Update standardrb to Ruby 3.0 standardsSchneems2023-12-042-3/+3
| | | | https://github.com/ruby/syntax_suggest/commit/2771dcabe0
* [rubygems/rubygems] major_deprecation accepts :removed_messageEric Mueller2023-12-011-0/+30
| | | | | | | If supplied, it uses that in place of the message for the case where the deprecation version is already past. https://github.com/rubygems/rubygems/commit/1deb73663c
* Fix failing specMisaki Shioi2023-11-301-1/+1
|
* [rubygems/rubygems] Allow auto-install to install missing git gemsSamuel Giddins2023-11-301-0/+17
| | | | | | | | | | | | Currently, auto-install with git gems fails, when it would succeed with a rubygems-source gem Fix the issue by doing the same fallback for git errors as we do for missing gems, the git errors should only bubble up in these cases when the gem is not installed, meaning we want to go through the install flow (and any persistent errors will be raised through there) https://github.com/rubygems/rubygems/commit/e25a339f7a
* Do not call the inplicit convercion spec on older ruby versionsTema Bolshakov2023-11-291-10/+12
|
* Fix Array#rassoc specTema Bolshakov2023-11-291-3/+3
|
* Update to ruby/spec@c3206f6Benoit Daloze2023-11-2742-128/+480
|
* Update to ruby/mspec@9f83eeaBenoit Daloze2023-11-271-7/+23
|
* Opaque Etags for compact index requestsJosef Šimánek2023-11-2710-45/+414
| | | | | | | | | | | | | This changes the CompactIndexClient to store etags received from the compact index in separate files rather than relying on the MD5 checksum of the file as the etag. Smoothes the upgrade from md5 etags to opaque by generating them when no etag file exists. This should reduce the initial impact of changing the caching behavior by reducing cache misses when the MD5 etag is the same. Eventually, the MD5 behavior should be retired and the etag should be considered completely opaque with no assumption that MD5 would match.
* [rubygems/rubygems] Don't remember `--jobs` flagDavid Rodríguez2023-11-271-0/+10
| | | | https://github.com/rubygems/rubygems/commit/9ab1136036
* [rubygems/rubygems] Fix advice in `bundle install --system` deprecationDavid Rodríguez2023-11-271-1/+1
| | | | https://github.com/rubygems/rubygems/commit/59a66e3560
* [rubygems/rubygems] Avoid some unnecessary quotes in remember flag ↵David Rodríguez2023-11-271-11/+11
| | | | | | deprecation message https://github.com/rubygems/rubygems/commit/3fd627e486
* [rubygems/rubygems] Simplify remembered flags deprecation messageDavid Rodríguez2023-11-271-3/+3
| | | | | | Configuration is now local by default. https://github.com/rubygems/rubygems/commit/6bc7709aa8
* [rubygems/rubygems] Remove no longer necessary workaround for old RubyGemsDavid Rodríguez2023-11-2713-34/+26
| | | | https://github.com/rubygems/rubygems/commit/ed4eaefac0
* [rubygems/rubygems] Reduce allocations when installing gems with bundlerSamuel Giddins2023-11-261-2/+4
| | | | | | | | | | | | | | | | | ``` ==> memprof.after.txt <== Total allocated: 1.13 MB (2352 objects) Total retained: 10.08 kB (78 objects) ==> memprof.before.txt <== Total allocated: 46.27 MB (38439 objects) Total retained: 9.94 kB (75 objects) ``` Yes, we were allocating 45MB of arrays in `dependencies_installed?`, it was accidentally cubic. https://github.com/rubygems/rubygems/commit/13ab874388
* [rubygems/rubygems] Add --json bundle-outdated flag to produce ↵Eric Mueller2023-11-231-0/+21
| | | | | | json-parseable output https://github.com/rubygems/rubygems/commit/65efa44bc0
* [rubygems/rubygems] Fix universal lockfiles regressionDavid Rodriguez2023-11-221-0/+58
| | | | | | | | | | | | If a platform specific variant would not match the current Ruby, we would still be considering it compatible with the initial resolution and adding its platform to the lockfile, but we would later fail to materialize it for installation due to not really being compatible. Fix is to only add platforms for variants that are also compatible with current Ruby and RubyGems versions. https://github.com/rubygems/rubygems/commit/75d1290843
* [rubygems/rubygems] Fix invalid platform removal missing adjacent platformsBo Anderson2023-11-211-0/+1
| | | | https://github.com/rubygems/rubygems/commit/4ce66c41a2
* [rubygems/rubygems] User bundler UA when downloading gemsSamuel Giddins2023-11-157-18/+15
| | | | | | | | | | | | | | | Gem::RemoteFetcher uses Gem::Request, which adds the RubyGems UA. Gem::RemoteFetcher is used to download gems, as well as the full index. We would like the bundler UA to be used whenever bundler is making requests. This PR also avoids unsafely mutating the headers hash on the shared `Gem::RemoteFetcher.fetcher` instance, which could cause corruption or incorrect headers when making parallel requests. Instead, we create one remote fetcher per rubygems remote, which is similar to the connection segregation bundler is already doing https://github.com/rubygems/rubygems/commit/f0e8dacdec
* [rubygems/rubygems] Make sure to `require "rubygems"` explicitlyNobuyoshi Nakada2023-11-132-6/+15
| | | | | | | This is also done in bundler/lib/bundler/rubygems_integration.rb, but bundler/lib/bundler.rb loads this file before it. https://github.com/rubygems/rubygems/commit/8840d8507b
* [rubygems/rubygems] Add a warning in an edge case of using `gemspec` DSLDavid Rodríguez2023-11-131-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | If a Gemfile duplicates a development dependency also defined in a local gemspec with a different requirement, the requirement in the local gemspec will be silently ignored. This surprised me. I think we should either: * Make sure both requirements are considered, like it happens for runtime dependencies (I added a spec to illustrate the current behavior here). * Add a warning that the requirement in the gemspec will be ignored. I think the former is slightly preferable, but it may cause some bundle's that previously resolve to no longer resolver. I went with the latter but the more I think about it, the more this seems like it should behave like the former. https://github.com/rubygems/rubygems/commit/ad6843972f
* [rubygems/rubygems] Let RuboCop target Ruby 3.0David Rodríguez2023-11-133-5/+5
| | | | https://github.com/rubygems/rubygems/commit/70243b1d72
* [rubygems/rubygems] Drop support for Ruby 2.6 and Ruby 2.7 in BundlerDavid Rodríguez2023-11-1318-71/+22
| | | | https://github.com/rubygems/rubygems/commit/93619c97ff
* [rubygems/rubygems] Automatically lock extra ruby platformsDavid Rodríguez2023-11-136-41/+166
| | | | | | | | | | | | | | | | | | | | | | | | | Since we started locking the specific platform in the lockfile, that has created an annoying situation for users that don't develop on Linux. They will create a lockfile on their machines, locking their local platform, for example, darwin. But then that lockfile won't work automatically when deploying to Heroku for example, because the lockfile is frozen and the Linux platform is not included. There's the chance though that resolving against two platforms (Linux + the local platform) won't succeed while resolving for just the current platform will. So, instead, we check other platform specific variants available for the resolution we initially found, and lock those platforms and specs too if they satisfy the resolution. This is only done when generating new lockfiles from scratch, existing lockfiles should keep working as before, and it's only done for "ruby platforms", i.e., not Java or Windows which have their own complexities, and so are excluded. With this change, we expect that MacOS users can bundle locally and deploy to Heroku without needing to do anything special. https://github.com/rubygems/rubygems/commit/5f24f06bc5
* [rubygems/rubygems] Refactor platform test helpersDavid Rodriguez2023-11-134-9/+14
| | | | https://github.com/rubygems/rubygems/commit/7ab4c203f9
* [rubygems/rubygems] Remove unused `SpecSet#merge`David Rodríguez2023-11-131-18/+0
| | | | https://github.com/rubygems/rubygems/commit/53e0490b55
* IO#read always check the provided buffer is mutableJean Boussier2023-11-091-0/+26
| | | | Otherwise you can have work in some circumstance but not in others.
* [rubygems/rubygems] Fix daily Bundler CIDavid Rodríguez2023-11-091-2/+2
| | | | | | | | | | Daily Bundler CI against ruby-head is failing because ruby-head now uses bigdecimal 3.1.5, so that gets locked by this spec. This change should make the test stable until bigdecimal 99.1.5 is bundled with Ruby :) https://github.com/rubygems/rubygems/commit/830326041f
* [rubygems/rubygems] Explicitly pass install-dir when installing system gems ↵David Rodríguez2023-11-091-8/+8
| | | | | | | | | | | | in Bundler specs We want to avoid any "user home" fallbacks, since that won't work with Bundler. So if there's a permissions issue during specs, it's best to raise immediately. https://github.com/rubygems/rubygems/commit/767a3e7533
* [rubygems/rubygems] No need to let this command failDavid Rodríguez2023-11-091-1/+1
| | | | | | This command is not expected to fail. If it fails, we can stop the test. https://github.com/rubygems/rubygems/commit/2511a5b093
* [rubygems/rubygems] Remove unused logicDavid Rodríguez2023-11-091-3/+1
| | | | https://github.com/rubygems/rubygems/commit/2eb2860e9e
* Add foo.gemspec for failing testPeter Zhu2023-11-081-0/+13
| | | | | | | foo.gemspec was added in rubygems/rubygems@8d699ed096960ed9a6636bd27143952ff5f8addc but was not sync'd in commit b4bf8c9ee2d716adf5fc08e67c4b26d6a8f929c2. This causes the spec to fail.
* [rubygems/rubygems] Ensure we are using the same extension dirHan Young2023-11-081-0/+11
| | | | | | | | Since #6945 the extension dir changed to Gem::BasicSpecification's implementation, we didn't hook that in rubygems_ext.rb. So for universal rubies, we ended up using the universal platform name when installing, but arch replaced platform name when checking. This lead to native extensions can never be correctly installed on universal rubies. Hook Gem::BasicSpecifications so the behavior is consistent on installing and checking. https://github.com/rubygems/rubygems/commit/8d699ed096
* Escape the target string to be checkedNobuyoshi Nakada2023-11-081-3/+1
| | | | | | | | | Comparing file paths as strings may not work well for some reasons, symlink, relative `__FILE__`, etc. Some alternatives are possible: comparing with `File.realpath`, or with `File.identical?`, it should be most robust to escape the target string contained within this file itself.
* [rubygems/rubygems] Simplify spec wording and implementationDavid Rodríguez2023-11-081-17/+2
| | | | https://github.com/rubygems/rubygems/commit/3e7f1379fb
* [rubygems/rubygems] Better error when having an insecure install folderDavid Rodríguez2023-11-082-18/+30
| | | | https://github.com/rubygems/rubygems/commit/e41156e272