summaryrefslogtreecommitdiff
path: root/spec
AgeCommit message (Collapse)Author
2023-06-15[rubygems/rubygems] Improve error message in frozen mode edge caseDavid Rodríguez
When a top level dependency is missing from the lockfile, and we're in frozen mode, we should also print a "frozen error". https://github.com/rubygems/rubygems/commit/3e82b835e3
2023-06-15[rubygems/rubygems] Improve frozen mode error messageDavid Rodríguez
This error message is also printed when using `bundler/setup` in frozen model, so we're not necessarily installing any gems when it happens. This new message play nicer with all situations. https://github.com/rubygems/rubygems/commit/6874bbacce
2023-06-15[rubygems/rubygems] Use "frozen" rather than "deployment" in error messageDavid Rodríguez
I think it communicates better what's going on. https://github.com/rubygems/rubygems/commit/07a25767a4
2023-06-15[rubygems/rubygems] Show missing spec in lockfile incomplete error messageDavid Rodríguez
https://github.com/rubygems/rubygems/commit/b86caaa3d5
2023-06-15[rubygems/rubygems] Remove weird line breaks in the middle of error messageDavid Rodríguez
https://github.com/rubygems/rubygems/commit/22b8caf42f
2023-06-15[rubygems/rubygems] Make frozen mode spec also pass on Bundler 3David Rodríguez
https://github.com/rubygems/rubygems/commit/ad52f840f2
2023-06-15[rubygems/rubygems] This spec is independent from global sourcesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/d91c245921
2023-06-08[rubygems/rubygems] Stop publishing Gemfile in default gem templateGareth Adams
Similarly to how the other ignored files are intended for local development and not for production, the Gemfile and Gemfile.lock files for a gem only relate to local development and aren't useful to people installing the gem. https://github.com/rubygems/rubygems/commit/59049c04be
2023-06-06[rubygems/rubygems] Fix `path` vs `deployment` precedence when path set ↵David Rodríguez
through ENV The `deployment` setting sets `path` to `vendor/bundle` implicitly, but that should only apply if `path` is not set explicitly, at any level. https://github.com/rubygems/rubygems/commit/3552c064c1
2023-06-06[rubygems/rubygems] Unexclude some specs on bundler 3David Rodríguez
These should all be passing on Bundler 3. https://github.com/rubygems/rubygems/commit/4a8c172965
2023-06-06[rubygems/rubygems] Fill in missing deployment specsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/e16aa47b8f
2023-06-06[rubygems/rubygems] Remove redundant specsDavid Rodríguez
They are already tested above. https://github.com/rubygems/rubygems/commit/23073dcece
2023-06-06[rubygems/rubygems] Fix inline mode with multiple sourcesDavid Rodríguez
If we're in inline mode, Bundler first resolves using only local gems, and if some gems are missing, then it re-resolves using remote gems. However, "source resolution" from the initial "local" try was being memoized, resulting in Bundler not looking for some gems remotely in the second resolution. This commit forces a proper re-resolve in this case. https://github.com/rubygems/rubygems/commit/fdc631075e
2023-06-01rb_io_descriptor() is available since 3.1Benoit Daloze
2023-06-01Hide the usage of `rb_io_t` where possible. (#7880)Samuel Williams
This retries the compatible parts of the previously reverted PR so we can continue to update related code without breaking backwards compatibility. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-06-01Revert "Hide most of the implementation of `struct rb_io`. (#6511)"NARUSE, Yui
This reverts commit 18e55fc1e1ec20e8f3166e3059e76c885fc9f8f2. fix [Bug #19704] https://bugs.ruby-lang.org/issues/19704 This breaks compatibility for extension libraries. Such changes need a discussion.
2023-05-31[rubygems/rubygems] tool_dir needs to handle ruby/ruby repo nowHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/550d90f4ba
2023-05-30Merge RubyGems/Bundler master from 4076391fce5847689bf2ec402b17133fe4e32285Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/7873
2023-05-30Hide most of the implementation of `struct rb_io`. (#6511)Samuel Williams
* Add rb_io_path and rb_io_open_descriptor. * Use rb_io_open_descriptor to create PTY objects * Rename FMODE_PREP -> FMODE_EXTERNAL and expose it FMODE_PREP I believe refers to the concept of a "pre-prepared" file, but FMODE_EXTERNAL is clearer about what the file descriptor represents and aligns with language in the IO::Buffer module. * Ensure that rb_io_open_descriptor closes the FD if it fails If FMODE_EXTERNAL is not set, then it's guaranteed that Ruby will be responsible for closing your file, eventually, if you pass it to rb_io_open_descriptor, even if it raises an exception. * Rename IS_EXTERNAL_FD -> RUBY_IO_EXTERNAL_P * Expose `rb_io_closed_p`. * Add `rb_io_mode` to get IO mode. --------- Co-authored-by: KJ Tsanaktsidis <ktsanaktsidis@zendesk.com> Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-05-29Refactor guards for Time.new specBenoit Daloze
2023-05-29Unify error messages of rb_num2ulong and rb_num2ullPeter Zhu
The error messages were slightly different due, which causes different behaviour on 32-bit and 64-bit systems. Notes: Merged: https://github.com/ruby/ruby/pull/7872
2023-05-29Update to ruby/spec@c3677cfBenoit Daloze
2023-05-24Fix "runs a C function with the global lock unlocked and unlocks IO with the ↵Samuel Williams
generic RUBY_UBF_IO" on Windows. (#7848) * Enable borked spec. * Ensure win32 wrappers are visible and used. * Reorganise `read`/`write`/`pipe` in `thread_spec.c`. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-05-24Add a newline at EOF [ci skip]Nobuyoshi Nakada
2023-05-24Add support for pread/pwrite on windows. (#7827)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-05-23Hash.new: print a deprecation warning when receiving keyword arguments (#7828)Jean byroot Boussier
[Feature #19236] In Ruby 3.3, `Hash.new` shall print a deprecation warning if keyword arguments are passed instead of treating them as an implicit positional Hash. This will allow to safely introduce a `capacity` keyword argument in 3.4 Co-authored-by: Jean Boussier <byroot@ruby-lang.org> Notes: Merged-By: byroot <byroot@ruby-lang.org>
2023-05-23Manually merge syntax_suggest-1.1.0Hiroshi SHIBATA
2023-05-23[ruby/syntax_suggest] Fixschneems
https://github.com/ruby/syntax_suggest/pull/187 Handle if/else with empty/comment line Reported in #187 this code: ``` class Foo def foo if cond? foo else # comment end end # ... def bar if @recv end_is_missing_here end end ``` Triggers an incorrect suggestion: ``` Unmatched keyword, missing `end' ? 1 class Foo 2 def foo > 3 if cond? > 5 else 8 end 16 end ``` Part of the issue is that while scanning we're using newlines to determine when to stop and pause. This is useful for determining logically smaller chunks to evaluate but in this case it causes us to pause before grabbing the "end" that is right below the newline. This problem is similar to https://github.com/ruby/syntax_suggest/pull/179. However in the case of expanding same indentation "neighbors" I want to always grab all empty values at the end of the scan. I don't want to do that when changing indentation levels as it affects scan results. There may be some way to normalize this behavior between the two, but the tests really don't like that change. To fix this issue for expanding against different indentation I needed a way to first try and grab any additional newlines with the ability to rollback that guess. In #192 I experimented with decoupling scanning from the AroundBlockScan logic. It also added the ability to take a snapshot of the current scanner and rollback to prior changes. With this ability in place now we: - Grab extra empties before looking at the above/below line for the matching keyword/end statement - If there's a match, grab it - If there's no match, discard the newlines we picked up in the evaluation That solves the issue. https://github.com/ruby/syntax_suggest/commit/513646b912
2023-05-23[ruby/syntax_suggest] Refactor Scanner logic out of AroundBlockScan ↵schneems
introduce history AroundBlockScan started as a utility class that was meant to be used as a DSL for scanning and making new blocks. As logic got added to this class it became hard to reason about what exactly is being mutated when. I pulled the scanning logic out into it's own class which gives us a clean separation of concerns. This allowed me to remove a lot of accessors that aren't core to the logic provided by AroundBlockScan. In addition to this refactor the ScanHistory class can snapshot a scan. This allows us to be more aggressive with scans in the future as we can now snapshot and rollback if it didn't turn out the way we wanted. The change comes with a minor perf impact: before: 5.092678 0.104299 5.196977 ( 5.226494) after: 5.128536 0.099871 5.228407 ( 5.249542) This represents a 0.996x change in speed (where 1x would be no change and 2x would be twice as fast). This is a 0.38% decrease in performance which is negligible. It's likely coming from the extra blocks being created while scanning. This is negligible and if the history feature works well we might be able to make better block decisions which is means fewer calls to ripper which is the biggest bottleneck. While this doesn't fix https://github.com/ruby/syntax_suggest/issues/187 it's a good intermediate step that will hopefully make working on that issue easier. https://github.com/ruby/syntax_suggest/commit/ad8487d8aa
2023-05-21Fix typo in spec file description [ci skip]Ivanov-Anton
fixed typo for spec description Notes: Merged: https://github.com/ruby/ruby/pull/7832 Merged-By: nobu <nobu@ruby-lang.org>
2023-05-18Add Fiber#kill, similar to Thread#kill. (#7823)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-05-13fix wording of spec description [ci skip]Martin Dürst
2023-05-10[Bug #19597] Freeze script nameNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7709
2023-05-10Merge https://github.com/rubygems/rubygems/pull/6655 manually.Hiroshi SHIBATA
2023-05-09Relax regexp for console assertionHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/7781
2023-04-26marshal.c: shallow freeze user objectsJean Boussier
When `freeze: true` argument is passed. [Bug #19427] Notes: Merged: https://github.com/ruby/ruby/pull/7764
2023-04-25Update to ruby/spec@7f6ca5bBenoit Daloze
2023-04-25Workaround CRuby adding x86_64-linux-fake in $LOADED_FEATURESBenoit Daloze
2023-04-25Update to ruby/spec@7f69c86Benoit Daloze
2023-04-25Update to ruby/mspec@1d8cf64Benoit Daloze
2023-04-25[ruby/syntax_suggest] Clean up outputschneems
I previously left a comment stating I didn't know why a certain method existed. In investigating the code in `CaptureCodeContext#capture_before_after_kws` I found that it was added as to give a slightly less noisy output. The docs for AroundBlockScan#capture_neighbor_context only describe keywords as being a primary concern. I modified that code to only include lines that are keywords or ends. This reduces the output noise even more. This allows me to remove that `start_at_next_line` method. One weird side effect of the prior logic is it would cause this code to produce this output: ``` class OH def hello def hai end end ``` ``` 1 class OH > 2 def hello 4 def hai 5 end 6 end ``` But this code to produce this output: ``` class OH def hello def hai end end ``` ``` 1 class OH > 2 def hello 4 end 5 end ``` Note the missing `def hai`. The only difference between them is that space. With this change, they're now both consistent. https://github.com/ruby/syntax_suggest/commit/4a54767a3e
2023-04-25[ruby/syntax_suggest] standardrb --fix-unsafely spec/spec_helper.rbHiroshi SHIBATA
https://github.com/ruby/syntax_suggest/commit/6e266b3b2b
2023-04-24Allow anonymous memberless StructJeremy Evans
Previously, named memberless Structs were allowed, but anonymous memberless Structs were not. Fixes [Bug #19416] Notes: Merged: https://github.com/ruby/ruby/pull/7587
2023-04-23Check the precision of `getrusage` at runtimeNobuyoshi Nakada
2023-04-22Fix a guard of `Process.times`Nobuyoshi Nakada
`GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID` clock uses `getrusage` always if available as the name states. That is if it is implemented `getrusage` is available, regardless microseconds in its results. Notes: Merged: https://github.com/ruby/ruby/pull/7739
2023-04-22Fix an example of `Process.times`Nobuyoshi Nakada
Prior to commit 5806c54447439f2ba22892e4045e78dd80f96f0c, it was "at least one result with precision beyond milliseconds (with none-zero microseconds) should exist"; after this commit, "at least one result should have zero microseconds". This chance is lower than the previous condition. Notes: Merged: https://github.com/ruby/ruby/pull/7739
2023-04-21Skip when unix socket path is too longNobuyoshi Nakada
Eventually the path directly under "/tmp" is complained by `rm_r` in spec/mspec/lib/mspec/helpers/fs.rb. Notes: Merged: https://github.com/ruby/ruby/pull/7749
2023-04-20[rubygems/rubygems] Revert "Bundler::YAMLSerializer.load couldn't raise ↵Hiroshi SHIBATA
error when invalid yaml was provided" This reverts commit https://github.com/rubygems/rubygems/commit/cfcfde04c783. https://github.com/rubygems/rubygems/commit/ac21ae7083
2023-04-20Use ASCII-compatible encoding for testsNobuyoshi Nakada
Since these files are written in a wide character encoding, stop at first NUL byte and are actually empty. ASCII-incompatible encodings have never been supported as source encoding.
2023-04-19[rubygems/rubygems] Bundler::YAMLSerializer.load couldn't raise error when ↵Hiroshi SHIBATA
invalid yaml was provided https://github.com/rubygems/rubygems/commit/cfcfde04c7