Граф коммитов

1434 Коммитов

Автор SHA1 Сообщение Дата
Benoit Daloze 1af0319fc8 2.8 -> 3.0 in specs 2020-09-15 21:56:00 +02:00
Benoit Daloze 9b535f3ff7 Interpolated strings are no longer frozen with frozen-string-literal: true
* Remove freezestring instruction since this was the only usage for it.
* [Feature #17104]
2020-09-15 21:32:35 +02:00
Marc-Andre Lafortune 60f5d38482 [ruby/ostruct] Fix dup/clone 2020-09-14 16:10:37 -04:00
Marc-Andre Lafortune 125605abd9 [ruby/ostruct] method_missing is private 2020-09-14 16:10:37 -04:00
Benoit Daloze 178c1b0922 Make Mutex per-Fiber instead of per-Thread
* Enables Mutex to be used as synchronization between multiple Fibers
  of the same Thread.
* With a Fiber scheduler we can yield to another Fiber on contended
  Mutex#lock instead of blocking the entire thread.
* This also makes the behavior of Mutex consistent across CRuby, JRuby and TruffleRuby.
* [Feature #16792]
2020-09-14 16:44:09 +12:00
Hiroshi SHIBATA b194973dcd
Revert the related commits about `Tempfile.open` change.
Start with fa21985a7a
  to d7492a0be8
2020-09-09 21:10:48 +09:00
Marc-Andre Lafortune 5e16857315 Fix constant names set using const_set on a singleton class
Fixes [Bug #14895]
2020-09-02 00:05:14 -04:00
Nobuyoshi Nakada 2e80c8347e
Deprecate iterator? method
[Feature #15547] [Fix GH-2071]
2020-08-31 22:14:14 +09:00
卜部昌平 b674fc9ca2
Thread.exclusive: delete
Has been deprecated since 2069c9e031.

[Feature #17125][ruby-core:99636]
2020-08-31 18:08:57 +09:00
Benoit Daloze ff323b2a5c Adapt specs for the new Tempfile.open with block behavior 2020-08-29 12:11:07 +02:00
Benoit Daloze 1199f1a4aa Fix warnings related to new Socket.gethostby* deprecations 2020-08-29 11:58:56 +02:00
Benoit Daloze b49307c701 Update to ruby/spec@335eb9b 2020-08-28 20:26:02 +02:00
Benoit Daloze 3dd63108b0 Update to ruby/mspec@53a6e3e 2020-08-28 20:26:00 +02:00
Nobuyoshi Nakada 7e1fddba4a
States Time.at expects rational-like argument to respond to #to_int
https://bugs.ruby-lang.org/issues/17131
2020-08-28 19:47:29 +09:00
卜部昌平 cc2caa6edf do not test --version
`llvm-strip-7` is a sane valid strip command that LLVM 7 ships, albeit
it does not understand `--version`.  It is a bad idea to check that
option.  Instead just see if the command actually strips something.  A
copy of `/bin/sh` should suffice.  That file must be ubiquitous.
2020-08-22 00:33:37 +09:00
Nguyễn Quang Minh 1819652578
[Feature #16513] TracePoint#inspect returns "... file:line" (#3391)
* Fix debug documents to match Thread#to_s change (Feature #16412 ticket)

* TracePoint#inspect returns "... file:line" (Feature #16513)

* Guard older version of Ruby in Tracepoint inspection tests

* Focus on current thread only when running TracePoint inspection test
2020-08-06 11:56:24 +09:00
David Rodríguez 07dc9691a8 [rubygems/rubygems] https functionality was merged into `net/https`
https://github.com/rubygems/rubygems/commit/d81ce9e457
2020-07-31 21:07:19 +09:00
Benoit Daloze 241244739f Fix arity of Hash#to_proc [Bug #12671] 2020-07-29 18:09:53 +02:00
Kazuhiro NISHIYAMA 946cd6c534
Use https instead of http 2020-07-28 19:51:54 +09:00
Nobuyoshi Nakada f44114b502
Do not assume all compilers accept same flags as gcc 2020-07-28 16:43:38 +09:00
Benoit Daloze 126fd5f15c Update to ruby/spec@07164da 2020-07-27 21:41:08 +02:00
Benoit Daloze 7429841ab6 Update to ruby/mspec@9cffee9 2020-07-27 21:41:03 +02:00
Jeremy Evans d47e124857 Switch reserved for numbered parameter warning to SyntaxError 2020-07-22 08:34:51 -07:00
Nobuyoshi Nakada 840115bf46 Make StringIO encoding fixed
Get rid of affects by default external encoding.
2020-07-20 14:59:19 +09:00
David Rodríguez 5783d0dbfc Import remaining changes
The "sync with commits" scripts failed to properly import these for some
reason.
2020-07-15 16:05:12 +09:00
Utkarsh Gupta fd709382b6 [rubygems/rubygems] Tag the specs with :readline
The newly added specs needs to be tagged as
:readline, otherwise they fail on Windows with
the backtrace: `ZeroDivisionError: divided by 0`.

Such issues are already being skipped on Windows.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/391f860af4
2020-07-15 16:05:12 +09:00
Utkarsh Gupta c44c7019b5 [rubygems/rubygems] Add tests with different flag combinations
Since this PR was made because we missed checking
RuboCop offenses with different flags, therefore
adding tests so that all flag combinations are
tested.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/d08250efc2
2020-07-15 16:05:12 +09:00
David Rodríguez 4f9c673cab [rubygems/rubygems] Allow setting a tag prefix to be used by gem release tasks
https://github.com/rubygems/rubygems/commit/679008f23a
2020-07-15 16:05:12 +09:00
Utkarsh Gupta ca133c0366 [rubygems/rubygems] Fix line spacing to make Layout/EmptyLines happy
The Gemfile wasn't properly put in the last commit.
As a result, Layout/EmptyLines inspected an offense
in the Gemfile.

This also fixes the spec w.r.t change in the task
default.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/d1418fddd3
2020-07-15 16:05:12 +09:00
David Rodríguez 2fafc08aa3 [rubygems/rubygems] Remove unneeded trailing conditions on exitstatus
https://github.com/rubygems/rubygems/commit/27e0e4ecb6
2020-07-15 16:05:12 +09:00
David Rodríguez 547ba6608e [rubygems/rubygems] Easier way to find path to ruby binary
https://github.com/rubygems/rubygems/commit/cdc201f5c4
2020-07-15 16:05:12 +09:00
David Rodríguez 16823d4a05 [rubygems/rubygems] Remove unnecessary assertions on exitstatus
Since our helpers now raise by default if the subcommand fails, these
will never actually fail and are not necessary.

https://github.com/rubygems/rubygems/commit/6153b9321e
2020-07-15 16:05:12 +09:00
David Rodríguez 17b92d221f [rubygems/rubygems] No need to update remotes
Everything is already fetched locally.

https://github.com/rubygems/rubygems/commit/9c304639b1
2020-07-15 16:05:12 +09:00
David Rodríguez d189d31ce9 [rubygems/rubygems] Git clone already takes care of this
https://github.com/rubygems/rubygems/commit/6e0c28d3ab
2020-07-15 16:05:12 +09:00
David Rodríguez a73ea2126f [rubygems/rubygems] Clone rubygems from the local repo
It simplifies things and should avoid issues like the one we had where
the master branch had a bad `.gitattributes` file and changing it on a
PR would be disregarded.

In order for this to work, we need to make sure to fetch all tags from
the repository, so that they can properly be checked out later. This
does not apply to the case of testing against `RGV=..`, since no extra
cloning is needed there.

https://github.com/rubygems/rubygems/commit/d088d936b8
2020-07-15 16:05:12 +09:00
Utkarsh Gupta 5ebca6d709 [rubygems/rubygems] Skip this spec on ruby_core workflow
ruby_core has an 'ast.rb' file that gets in the
middle and breaks this spec, so it's better we skip
this test on this workflow for now.

Also, slightly change the spec name from "run" to
"runs" and change the last assertion, it's cleaner
to check empty error.
Thanks to David Rodríguez for this!

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/ba8eaa70c3
2020-07-15 16:05:12 +09:00
Utkarsh Gupta d0810fdee4 [rubygems/rubygems] Use latest version of rubocop for RUBY_VERSION > 2.4
With older versions of rubocop, the dependency on
`jaro_winkler` seems to be a pain.
However, in the later versions of rubocop, this
dependency was dropped. So we only need to use
the older version for ruby2.3.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/9cd87eaee3
2020-07-15 16:05:12 +09:00
Utkarsh Gupta 077dcacb08 [rubygems/rubygems] Use `--config .rubocop.yml` instead
because rubocop configuration inheritance is
messed up and when using `--ignore-parent-exclusion`,
even though the exit status is 0, the example
still fails because of the configuration issue.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/3e20b2738c
2020-07-15 16:05:12 +09:00
Utkarsh Gupta ecb87b55d8 [rubygems/rubygems] Lock rubocop version to 0.80.1
The later RuboCop versions don't work with ruby2.3
so we should lock the version to what works with
ruby2.3 as we haven't dropped the support yet.

And since we're using the older version of rubocop,
also fix `Max` value of `LineLength` to 120, which
is the current standard. Without this, rubocop
will throw the line length offenses.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/46d0a800a2
2020-07-15 16:05:12 +09:00
Utkarsh Gupta 215f7c3165 [rubygems/rubygems] Fix linting and make Style/RedundantInterpolation happy
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/83e330fa87
2020-07-15 16:05:12 +09:00
Utkarsh Gupta 4875a96edd [rubygems/rubygems] Fix test to run rubocop on the generated gem
With this, it will be ensured that the generated
(skeleton) gem will have no offenses.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/47411262e0
2020-07-15 16:05:12 +09:00
Utkarsh Gupta b28c6d04d0 [rubygems/rubygems] Make Style/HashSyntax cop happy
Previously, we were using the old syntax like:
`task :default => :spec`, but now this commit
uses the new Ruby 1.9 hash syntax.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/b41d0fdb56
2020-07-15 16:05:12 +09:00
Utkarsh Gupta 449d24200b [rubygems/rubygems] WIP: add test to run rubocop on the generated gem
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/730b770f8a
2020-07-15 16:05:12 +09:00
Utkarsh Gupta 084489be87 [rubygems/rubygems] Fix tests pertaining to newgem
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/e2ee0b7de3
2020-07-15 16:05:12 +09:00
David Rodríguez 2b73f26fde [rubygems/rubygems] Show also output from all commands on rubygems checkout errors
https://github.com/rubygems/rubygems/commit/1fe24e471d
2020-07-15 16:05:12 +09:00
David Rodríguez 5ae80c5207 [rubygems/rubygems] Remove `--quiet` flag to `git checkout`
Since we don't show this output by default, it's better to be verbose
in case we happen to need more info.

https://github.com/rubygems/rubygems/commit/baa4ccf5a6
2020-07-15 16:05:12 +09:00
MSP-Greg 23cf99e99d [rubygems/rubygems] Bundler specs - Windows - remove skips, File.open => File.readlines
Using File.open without a block leaves a file reference that causes issues with file operations

commands/binstubs_spec.rb
install/gems/compact_index_spec.rb
install/gems/dependency_api_spec.rb
install/gems/standalone_spec.rb
runtime/executable_spec.rb

https://github.com/rubygems/rubygems/commit/4b9a6ca156
2020-07-15 16:05:12 +09:00
MSP-Greg ad743337b3 [rubygems/rubygems] bundler/spec/commands/binstubs_spec.rb - remove global Windows skip
Added one skip for:
bundle binstubs <gem>
when the gem exists in the lockfile
when generating bundle binstub outside bundler
should abort

https://github.com/rubygems/rubygems/commit/b77b484889
2020-07-15 16:05:12 +09:00
Koichi Sasada c25d249e63 RBasci::flags (VALUE) doesn't match int.
The type of RBasic::flags is VALUE, and INT2FIX(flags) does not
make sense. Use correct type to represent.
2020-07-15 13:36:38 +09:00
Nobuyoshi Nakada 99a9c3fe2e
Fixed yday and wday with timezone [Bug #17024] 2020-07-12 21:58:13 +09:00
Bart de Water 3621a7debf Avoid deprecated OpenSSL::Digest constants 2020-06-29 13:25:32 +09:00
Benoit Daloze 0faf6c8c0e Update to ruby/spec@6c466d4 2020-06-27 16:40:16 +02:00
Benoit Daloze b3fa158d1c Update to ruby/spec@b6b7752 2020-06-27 15:51:37 +02:00
Benoit Daloze 64d8c0815e Update to ruby/mspec@6cb1f10 2020-06-27 15:51:35 +02:00
Jeremy Evans 878af5147d Implement Proc#== and #eql?
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]
2020-06-19 12:58:25 -07:00
Jeremy Evans aae8223c70 Dup splat array in certain cases where there is a block argument
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]
2020-06-18 08:19:33 -07:00
David Rodríguez 5f8ee14b9b [rubygems/rubygems] Make sure to pass URI's to `:git`
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
2020-06-18 19:14:15 +09:00
David Rodríguez f217faf1da [rubygems/rubygems] Better skip messages
https://github.com/rubygems/rubygems/commit/4f519638ae
2020-06-18 19:14:15 +09:00
David Rodríguez 414b1485d6 [rubygems/rubygems] More portable PATH edition
https://github.com/rubygems/rubygems/commit/a6d50afad0
2020-06-18 19:14:15 +09:00
Utkarsh Gupta 22ee047f73 [rubygems/rubygems] Only add .rubocop.yml when --rubocop flag is passed
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/ef2dae4222
2020-06-18 19:14:15 +09:00
Utkarsh Gupta ec98d56153 Ship default .rubocop.yml
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>
2020-06-18 19:14:15 +09:00
Utkarsh Gupta d9c888d394 [rubygems/rubygems] Only add .rubocop.yml when --rubocop flag is passed
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

https://github.com/rubygems/rubygems/commit/ef2dae4222
2020-06-18 19:14:15 +09:00
David Rodríguez 30f9fbdce8 Undeprecate the `--no-cache` flag
This is not a remembered option, so it shouldn't have been deprecated.
At least not for that reason.
2020-06-18 19:14:15 +09:00
David Rodríguez 9cc7847849 s/sys_exec!/sys_exec 2020-06-18 19:14:15 +09:00
David Rodríguez 77df7ccc10 [rubygems/rubygems] Remove now unused "bang helpers"
https://github.com/rubygems/rubygems/commit/84e4c58e83
2020-06-18 19:14:15 +09:00
David Rodríguez ea4824ee0f [rubygems/rubygems] s/run!/run
https://github.com/rubygems/rubygems/commit/e3f60d8aec
2020-06-18 19:14:15 +09:00
David Rodríguez 596588c697 [rubygems/rubygems] s/ruby!/ruby
https://github.com/rubygems/rubygems/commit/a73fa0760e
2020-06-18 19:14:15 +09:00
David Rodríguez a572e78201 [rubygems/rubygems] s/gem_command!/gem_command
https://github.com/rubygems/rubygems/commit/f52733f6a4
2020-06-18 19:14:15 +09:00
David Rodríguez 696a50751b [rubygems/rubygems] s/install_gemfile!/install_gemfile
https://github.com/rubygems/rubygems/commit/4d1a0c465a
2020-06-18 19:14:15 +09:00
David Rodríguez 1436b5026c [rubygems/rubygems] s/bundle!/bundle
https://github.com/rubygems/rubygems/commit/746a4b3d74
2020-06-18 19:14:15 +09:00
Frank Lam a1a5973daa [rubygems/rubygems] Prefer using bundle! to avoid unnecessary swallowing of errors
https://github.com/rubygems/rubygems/commit/6bac832a58
2020-06-18 19:14:15 +09:00
Frank Lam f6c8ca0359 [rubygems/rubygems] Move already configured --test hint to before test file creation
https://github.com/rubygems/rubygems/commit/9e5f7a9099
2020-06-18 19:14:15 +09:00
Frank Lam 0ba2f3e8a9 [rubygems/rubygems] Move already configured --ci hint to before CI file creation
https://github.com/rubygems/rubygems/commit/2af2abe5fd
2020-06-18 19:14:15 +09:00
Frank Lam 091daaa715 [rubygems/rubygems] Lower verboseness of user-facing text for bundle gem
https://github.com/rubygems/rubygems/commit/288f073c3c
2020-06-18 19:14:15 +09:00
Frank Lam 8e3136a03b [rubygems/rubygems] Make test framework/CI configuration for bundle gem consistent
* Add hints for --ci option

https://github.com/rubygems/rubygems/commit/5f779f45b0
2020-06-18 19:14:15 +09:00
Frank Lam 27e07cd34f [rubygems/rubygems] Set CI global config to false in gem_helper_spec
https://github.com/rubygems/rubygems/commit/39b18fe7fc
2020-06-18 19:14:15 +09:00
Frank Lam 760edb3743 [rubygems/rubygems] Fix CI spec typo
Co-authored-by: Olle Jonsson <olle.jonsson@gmail.com>
https://github.com/rubygems/rubygems/commit/24f3739585
2020-06-18 19:14:15 +09:00
Frank Lam 52a900773e [rubygems/rubygems] Incorporate naming/grammar suggestions from olleolleolle
https://github.com/rubygems/rubygems/commit/80571452ca
2020-06-18 19:14:15 +09:00
Frank Lam e6479ac3f6 [rubygems/rubygems] Move CI specs below test framework specs
https://github.com/rubygems/rubygems/commit/d8e416d89b
2020-06-18 19:14:15 +09:00
Frank Lam 0d3c185b59 [rubygems/rubygems] Remove shared examples for present test framework
* `bundle gem` has new option to select CI provider

https://github.com/rubygems/rubygems/commit/320f3546c1
2020-06-18 19:14:15 +09:00
Frank Lam 25ac5b3606 [rubygems/rubygems] Separate CI and test framework shared examples
* `bundle gem` has new option to choose CI provider other than Travis CI

https://github.com/rubygems/rubygems/commit/afaecf16de
2020-06-18 19:14:15 +09:00
Frank Lam b46895aa93 [rubygems/rubygems] Extract shared example for absence of CI files
https://github.com/rubygems/rubygems/commit/22cb599bcc
2020-06-18 19:14:15 +09:00
Hiroshi SHIBATA cc059b16b2 Manually cherry-picked at 80260b3496 2020-06-18 19:14:15 +09:00
David Rodríguez 9be1baedbc [rubygems/rubygems] Remove unnecessary `bundle install`
These specs doesn't really need an installed bundle, they only need a
`Gemfile`.

https://github.com/rubygems/rubygems/commit/06c85683ae
2020-06-18 19:14:15 +09:00
David Rodríguez 61b6f53337 [rubygems/rubygems] Make helpers raise by default
https://github.com/rubygems/rubygems/commit/ade0c441d5
2020-06-18 19:14:15 +09:00
David Rodríguez 529a9e8a1f [rubygems/rubygems] Fix a couple of specs that were loading an incorrect bundler
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
2020-06-18 19:14:15 +09:00
David Rodríguez 5d78fb1c9a [rubygems/rubygems] Change spec to do the right thing on bundler 3
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
2020-06-18 19:14:15 +09:00
David Rodríguez 974c40c842 [rubygems/rubygems] Fix some sudo specs to do the right thing on bundler 3
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
2020-06-18 19:14:15 +09:00
David Rodríguez 5454415750 [rubygems/rubygems] Fix spec to test the right thing on bundler 3
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
2020-06-18 19:14:15 +09:00
David Rodríguez 9939f4ad43 [rubygems/rubygems] Remove bad `bundle install`
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
2020-06-18 19:14:15 +09:00
David Rodríguez 8d7ed194cb [rubygems/rubygems] Simplify `bundle update --ruby` specs
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
2020-06-18 19:14:15 +09:00
David Rodríguez 66b327af56 [rubygems/rubygems] Fix redundant commands
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
2020-06-18 19:14:15 +09:00
David Rodríguez cceb77f57b [rubygems/rubygems] Fix unintended Gemfile installation
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
2020-06-18 19:14:15 +09:00
David Rodríguez 6aafea2d99 [rubygems/rubygems] Remove failing command that doesn't affect the spec
This command was silently failing but doesn't really affect the outcome
of the spec.

https://github.com/rubygems/rubygems/commit/7880d08146
2020-06-18 19:14:15 +09:00
David Rodríguez a8f9a97d49 [rubygems/rubygems] Remove broken test
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:

* 105654a31e
* ae53be1f87
* d19f4a7b32
* 092f169d01
* 36878435b5

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
2020-06-18 19:14:15 +09:00
David Rodríguez acd82bd923 [rubygems/rubygems] Fix silently broken spec
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
2020-06-18 19:14:15 +09:00
David Rodríguez b0f07aff0b [rubygems/rubygems] Remove incorrect tags
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
2020-06-18 19:14:15 +09:00
David Rodríguez 8c686475c8 [rubygems/rubygems] Migrate some specs to use "the new way"
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
2020-06-18 19:14:15 +09:00
David Rodríguez 94fc709dd1 [rubygems/rubygems] s/rails_fail/rails_pinned_to_old_activesupport/
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
2020-06-18 19:14:15 +09:00
David Rodríguez f8f3f11ed5 [rubygems/rubygems] Fix `only_update_to_newer_versions` regression
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
2020-06-18 19:14:15 +09:00
David Rodríguez 094fb6ae0d Accommodate process title spec to ruby-core setup
I'm guessing the commands under ruby-core setup are very long, so the
title gets truncated. Use a shorter title, since the test doesn't really
care.
2020-06-15 12:38:39 +09:00
David Rodríguez 117b504b98 Fix most exec specs
The `gem_command` helper was failing to require `support/hax.rb`, which
takes care of making sure rubygems actually picks up the right `ruby`
executable under ruby-core setup (`ENV["RUBY"]`). This caused binstubs
to be generated with a wrong shebang, and that caused `bundle exec` to
not work. The error message was pretty confusing though due to
https://bugs.ruby-lang.org/issues/16952.
2020-06-15 12:38:39 +09:00
Nobuyoshi Nakada 1efc3d6d65
Suppress warnings [Feature #15973] 2020-06-13 22:57:31 +09:00
Nobuyoshi Nakada a6713a5758
Refined ioctl error description 2020-06-11 14:31:39 +09:00
Jeremy Evans f3e927b0cc Make proc/Proc.new without block an error instead of warning
The warning for these was added in 2.7.
2020-06-10 17:49:54 -07:00
Nobuyoshi Nakada 04fddf3573 ENV.delete should return the result of block on non-existing key
Fixes [Bug #16173]

Co-Authored-By: Burdette Lamar <burdettelamar@yahoo.com>
Co-Authored-By: Jeremy Evans <code@jeremyevans.net>
2020-06-10 12:49:27 -07:00
Yuki Nishijima 7cfd6a0bb9 Fix build failures 2020-06-06 13:02:08 -04:00
Hiroshi SHIBATA 459eb684b7 Manually pick from rubygems/rubygems changes at
ca5bf58402
2020-06-05 07:32:42 +09:00
David Rodríguez 4d233d18a2 Re-record all cassettes
I had to pin `redis-namespace` in our spec to 1.6.0 because on ruby
2.3.0 the spec no longer resolved to that version, so the cached `.gem`
file was missing there.
2020-06-05 07:32:42 +09:00
David Rodríguez 0fb2a7fa1c Fix `bin/rake spec:realworld:record`
Previously it was failing and not recording. Also, the
`BUNDLER_SPEC_FORCE_RECORD` environment variable was forcing every
request to be recorded, including duplicated requests to the same
endpoint. That meant the recorded `versions` file would be incorrect
because it would contain the result of the last request, which would be
`304 NOT MODIFIED`.

So, to rerecord, delete cassettes and let them be recorded when needed.
2020-06-05 07:32:42 +09:00
Carsten Wirth 0ae5cd55e5 [rubygems/rubygems] Remove multiline gem specifications correctly
https://github.com/rubygems/rubygems/commit/8dca0ad56e
2020-06-05 07:32:42 +09:00
DEVRAJ KUMAR 9139acca66 [rubygems/rubygems] Fix `bundle info` not indicating a gem which has been deleted, unlike `bundle show`
Co-Authored-By: David Rodríguez <deivid.rodriguez@riseup.net>

https://github.com/rubygems/rubygems/commit/2851b40ffb
2020-06-05 07:32:42 +09:00
Frank Lam 0d240de2f3 [rubygems/rubygems] Tag test framework hint specs and use out helper
https://github.com/rubygems/rubygems/commit/1db61b5b5e
2020-06-05 07:32:42 +09:00
Frank Lam 154c2717da [rubygems/rubygems] Add user hint specs for bundle gem --test
https://github.com/rubygems/rubygems/commit/1d2292a88f
2020-06-05 07:32:42 +09:00
Frank Lam f75bd9bb8b [rubygems/rubygems] Fix bundle gem ignoring global gem.test config
* bundle gem previously ignored gem.test when passed empty -t flag,
defaulting to RSpec
* bundle gem will now ask user for test framework when passed empty -t
flag and gem.test is set to false, but will not overwrite gem.test
* thor option parsing for String types falls back to human name for nil,
so setting lazy_default to nil won't work
* c5161501e0/lib/thor/parser/options.rb (L224)

Default to Bundler.settings["gem.test"] for empty --test

Add shared examples for test framework to newgem spec

Add examples for empty --test flag to newgem spec

Simplify conditional for prompting test framework

Follow naming conventions for bundler settings

Add more descriptive test framework help text for bundle gem

Update man pages for bundler

https://github.com/rubygems/rubygems/commit/ab0785a09f
2020-06-05 07:32:42 +09:00
David Rodríguez e413e746af [rubygems/rubygems] Remove `forgotten_command_line_usages` from specs
Instead, use the non-deprecated option except when specifically testing
deprecated CLI flags. In that case, pass the flag directly and limit
the specs to `bundler < 3`.

https://github.com/rubygems/rubygems/commit/3d5e186241
2020-06-05 07:32:42 +09:00
David Rodríguez 61b61f426a [rubygems/rubygems] Reword specs to not mention deprecated flags
https://github.com/rubygems/rubygems/commit/f878a81f22
2020-06-05 07:32:42 +09:00
David Rodríguez f02f19d62f [rubygems/rubygems] Rewrite dependency API specs to use new deployment mode
Some of them were passing "by chance" because they used a `bundle
install` command that failed, but the assertion was using the result of
the previous. Others were skipped on bundler 3. Now they all pass in all
versions.

https://github.com/rubygems/rubygems/commit/cedf611e11
2020-06-05 07:32:42 +09:00
David Rodríguez 5c924f597f [rubygems/rubygems] Make `forgotten_command_line_options` always "forget" options
https://github.com/rubygems/rubygems/commit/4d39338670
2020-06-05 07:32:42 +09:00
David Rodríguez 99dc55987d [rubygems/rubygems] Improve specs testing option remembering behavior
By making them more explicit.

https://github.com/rubygems/rubygems/commit/9979c5a811
2020-06-05 07:32:42 +09:00
David Rodríguez 332ecb0ad1 [rubygems/rubygems] Fix `bundle install` unintentionally saving configuration
Even if no explicit flags were passed to it.

https://github.com/rubygems/rubygems/commit/0598cbb68c
2020-06-05 07:32:42 +09:00
David Rodríguez 052d66050a [rubygems/rubygems] Change descriptions to not mention deprecated flags
https://github.com/rubygems/rubygems/commit/731b3783f1
2020-06-05 07:32:42 +09:00
David Rodríguez fed9419e55 [rubygems/rubygems] Fix flag name in spec descriptions
https://github.com/rubygems/rubygems/commit/6395392b83
2020-06-05 07:32:42 +09:00
David Rodríguez 5989827dc7 [rubygems/rubygems] Improve wording of some specs
https://github.com/rubygems/rubygems/commit/3372b21553
2020-06-05 07:32:42 +09:00
David Rodríguez ff74725dc3 [rubygems/rubygems] Remove old no longer meaningful spec
This spec was originally written many years ago to verity gems were
properly "remembered" in the lock file. At this point, the test feels a
bit dummy since the first `bundle install` already runs on a "clean
machine".

https://github.com/rubygems/rubygems/commit/dbfefb3f5a
2020-06-05 07:32:42 +09:00
David Rodríguez 09602f4301 [rubygems/rubygems] Revert multi ruby{,gems} version requirement fix
This reverts commit 20f06d9e178211a3016133852b72d21ac7bb93ad, reversing
changes made to f2b30cb70df8a518bef0e8a64bbceb86234d922d.

https://github.com/rubygems/rubygems/commit/40802bdb18
2020-06-05 07:32:42 +09:00
David Rodríguez 592762069d [rubygems/rubygems] Support running specs against a tarball
When bundler specs are run from a ruby tarball (ruby-core does this),
there's no git folder, so `git ls-files` fails.

Support this case by making specs rely on the list of files from the
bundler gemspec instead, and invert the spec that makes sure we ship the
right set of files.

As per the other quality specs, skip them in this case.

https://github.com/rubygems/rubygems/commit/b28d5ec931
2020-06-05 07:32:42 +09:00
David Rodríguez bd9a6ba4ef [rubygems/rubygems] Remove unintended extra space
https://github.com/rubygems/rubygems/commit/1cc02930f3
2020-06-05 07:32:42 +09:00
Hiroshi SHIBATA 9f7bfba54f Revert "Fix a error in a `before(:suite)` hook"
This reverts commit 67d2a715ca.
2020-06-05 07:32:42 +09:00
Hiroshi SHIBATA 1ab410caf8 Revert "Fix a failure in bundle version with version outputs the version with build metadata"
This reverts commit fcc8be0198.
2020-06-05 07:32:42 +09:00
David Rodríguez d52b1b0705 [rubygems/rubygems] Deprecate the `--no-deployment` flag
And never recommend it inside CLI messages.

This flag represents the default behaviour of `bundle install`, and the
only reason it exists is to "override" previous `--deployment` flag
usages which were silently remembered. So it should be deprecated just
like all the other flags the rely on remembering their values across
invocations.

https://github.com/rubygems/rubygems/commit/40e50b7190
2020-06-05 07:32:42 +09:00
David Rodríguez 1914c4e9b1 [rubygems/rubygems] Pass `--deployment` flag directly
This spec is run only in bundler 2 mode, and it's testing the
`--deployment` flag specifically.

https://github.com/rubygems/rubygems/commit/a5d91c68b6
2020-06-05 07:32:42 +09:00
David Rodríguez 5a12fc7c7f [rubygems/rubygems] Unskip "monorepo issues"
They seem to be passing?

https://github.com/rubygems/rubygems/commit/a00d1e6896
2020-06-05 07:32:42 +09:00
Jeremy Evans 98286e9850 Ensure origins for all included, prepended, and refined modules
This fixes various issues when a module is included in or prepended
to a module or class, and then refined, or refined and then included
or prepended to a module or class.

Implement by renaming ensure_origin to rb_ensure_origin, making it
non-static, and calling it when refining a module.

Fix Module#initialize_copy to handle origins correctly.  Previously,
Module#initialize_copy did not handle origins correctly.  For example,
this code:

```ruby
module B; end
class A
  def b; 2 end
  prepend B
end
a = A.dup.new
class A
  def b; 1 end
end
p a.b
```

Printed 1 instead of 2.  This is because the super chain for
a.singleton_class was:

```
a.singleton_class
A.dup
B(iclass)
B(iclass origin)
A(origin) # not A.dup(origin)
```

The B iclasses would not be modified, so the includer entry would be
still be set to A and not A.dup.

This modifies things so that if the class/module has an origin,
all iclasses between the class/module and the origin are duplicated
and have the correct includer entry set, and the correct origin
is created.

This requires other changes to make sure all tests still pass:

* rb_undef_methods_from doesn't automatically handle classes with
  origins, so pass it the origin for Comparable when undefing
  methods in Complex. This fixed a failure in the Complex tests.

* When adding a method, the method cache was not cleared
  correctly if klass has an origin.  Clear the method cache for
  the klass before switching to the origin of klass.  This fixed
  failures in the autoload tests related to overridding require,
  without breaking the optimization tests.  Also clear the method
  cache for both the module and origin when removing a method.

* Module#include? is fixed to skip origin iclasses.

* Refinements are fixed to use the origin class of the module that
  has an origin.

* RCLASS_REFINED_BY_ANY is removed as it was only used in a single
  place and is no longer needed.

* Marshal#dump is fixed to skip iclass origins.

* rb_method_entry_make is fixed to handled overridden optimized
  methods for modules that have origins.

Fixes [Bug #16852]
2020-06-03 09:50:37 -07:00
Benoit Daloze 160511d851 Quarantine specs which fail frequently with CHECK_LEAKS=true 2020-06-03 12:11:58 +02:00
Jean Boussier ae8362fdc8 Add a spec for the new NoMethodError display of the receiver 2020-06-02 16:57:32 +02:00
Benoit Daloze b7e1de117e Make sure rb_enc_str_new_static() is used when enc is NULL
* The definition of the rb_enc_str_new_cstr macro depends on
  HAVE_BUILTIN___BUILTIN_CONSTANT_P.
* It SEGV on mswin otherwise.
2020-06-01 00:30:41 +02:00
Benoit Daloze 34776105c8 Update to ruby/spec@4e486fa 2020-05-31 18:22:49 +02:00
Benoit Daloze f4502b001a Update to ruby/mspec@e3abf6b 2020-05-31 18:22:47 +02:00
Benoit Daloze 5a79d8e050 Fix error raised by Net::HTTPResponse#inflater if the block raises
* See https://bugs.ruby-lang.org/issues/13882#note-6
2020-05-31 12:48:14 +02:00
Benoit Daloze 5b4b82b712 Fix spec description for Net::HTTP.get 2020-05-31 12:48:14 +02:00
Yusuke Endoh e73e504e2f spec: add wsl guard
WSL 2 is officially released.  It uses Linux kernel, so almost all specs
for Linux work on WSL, except one: gethostbyaddr.  I guess network
resolution in WSL is based on Windows, so the behavior seems a bit
different from normal Linux.

This change adds `platform_is_not :wsl` guard, and guards out the test
in question.
2020-05-30 01:52:38 +09:00
Jean Boussier 385ac07fd8 Use receiver #name rather than #inspect to build NameError message 2020-05-26 14:10:33 +09:00
Kazuhiro NISHIYAMA b10b37924a
Fix failures in ./spec/bundler/quality_spec.rb
```
Failures:

  1) The library itself does not contain any warnings
     Failure/Error: raise "Invoking #{method}!(#{args.map(&:inspect).join(", ")}) failed:\n#{last_command.stdboth}"

     RuntimeError:
       Invoking sys_exec!("ruby -w") failed:
       /home/user/snapshot-master/lib/bundler/cli/add.rb:4:in `<module:Bundler>': uninitialized constant Bundler::CLI (NameError)
        from /home/user/snapshot-master/lib/bundler/cli/add.rb:3:in `<top (required)>'
        from /home/user/snapshot-master/lib/rubygems/core_ext/kernel_require.rb:91:in `require'
        from /home/user/snapshot-master/lib/rubygems/core_ext/kernel_require.rb:91:in `require'
        from -:2:in `<main>'

       Commands:
       $ ruby -w
       /home/user/snapshot-master/lib/bundler/cli/add.rb:4:in `<module:Bundler>': uninitialized constant Bundler::CLI (NameError)
        from /home/user/snapshot-master/lib/bundler/cli/add.rb:3:in `<top (required)>'
        from /home/user/snapshot-master/lib/rubygems/core_ext/kernel_require.rb:91:in `require'
        from /home/user/snapshot-master/lib/rubygems/core_ext/kernel_require.rb:91:in `require'
        from -:2:in `<main>'
       # $? => 1
```
2020-05-25 20:12:41 +09:00
Kazuhiro NISHIYAMA fcc8be0198
Fix a failure in bundle version with version outputs the version with build metadata
```
  1) bundle version with version outputs the version with build metadata
     Failure/Error: expect(out).to match(/\ABundler version #{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit #{COMMIT_HASH}\)\z/)

       expected "Bundler version 2.2.0.dev (2020-05-25 commit )" to match /\ABundler version 2\.2\.0\.dev \(\d{4}-\d{2}-\d{2} commit (?-mix:unknown|[a-fA-F0-9]{7,})\)\z/
       Diff:
       @@ -1,2 +1,2 @@
       -/\ABundler version 2\.2\.0\.dev \(\d{4}-\d{2}-\d{2} commit (?-mix:unknown|[a-fA-F0-9]{7,})\)\z/
       +"Bundler version 2.2.0.dev (2020-05-25 commit )"

       Commands:
       $ /home/user/snapshot-master/ruby -I/home/user/snapshot-master/spec/bundler -r/home/user/snapshot-master/spec/bundler/support/artifice/fail.rb -r/home/user/snapshot-master/spec/bundler/support/hax.rb /home/user/snapshot-master/tmp/1/gems/system/bin/bundle version
       Bundler version 2.2.0.dev (2020-05-25 commit )
       # $? => 0
```
2020-05-25 20:08:30 +09:00
Kazuhiro NISHIYAMA 67d2a715ca
Fix a error in a `before(:suite)` hook
https://github.com/ruby/actions/runs/703745101?check_suite_focus=true#step:16:27
```
An error occurred in a `before(:suite)` hook.
Failure/Error: contents = File.read(version_file)

Errno::ENOENT:
  No such file or directory @ rb_sysopen - /home/runner/work/actions/actions/snapshot-master/tmp/1/bundler-2.2.0.dev/lib/bundler/version.rb
```
2020-05-25 20:08:30 +09:00
Hiroshi SHIBATA df5fd1d09c Fixup 1d079a0c5d4d80860a4d6d692344124fe5c562b5 2020-05-22 20:32:30 +09:00
Hiroshi SHIBATA 1d889c9656 Sync Bundler PR #3624 with HEAD commits 2020-05-22 20:32:30 +09:00
Hiroshi SHIBATA 93ebf9643d Revert 1f011cccb1 2020-05-22 20:32:30 +09:00
Hiroshi SHIBATA 26367367ec Marked the failing examples with the current master branch on ruby repository 2020-05-22 20:32:30 +09:00
Hiroshi SHIBATA c7ebeb7eda Sync Bundler PR #3624 2020-05-22 20:32:30 +09:00
Kazuhiro NISHIYAMA 6c1a51dae8
Skip some tests if extracted from tarball (again)
Fix up previous commit

ref
9aa75795f9,
38002a8adb, and
0e60b59d58
2020-05-19 00:58:33 +09:00
Kazuhiro NISHIYAMA 1f011cccb1
Skip some tests if extracted from tarball (again)
ref 9aa75795f9
2020-05-18 23:18:44 +09:00
Samuel Williams 0e3b0fcdba
Thread scheduler for light weight concurrency. 2020-05-14 22:10:55 +12:00
Hiroshi SHIBATA 35bbbc751d clean-up .bundle directory in bundled_app 2020-05-14 09:11:28 +09:00
Hiroshi SHIBATA d4acf254e3 Use the gemspec in build_dir directly 2020-05-14 09:11:28 +09:00
Hiroshi SHIBATA cecd343336 Skip the examples for bundle exec with gem installation 2020-05-13 07:54:37 +09:00
Hiroshi SHIBATA f61dbb921e Marked the some examples that are not working with the ruby repository 2020-05-13 07:54:37 +09:00
Hiroshi SHIBATA aecbb78517 Use relative path in ruby core repository 2020-05-13 07:54:37 +09:00
Hiroshi SHIBATA 143872bf98 Unmask the some of examples with ruby_repo label 2020-05-13 07:54:37 +09:00
Hiroshi SHIBATA ca892e6902 Skip the example to use rake command 2020-05-13 07:54:37 +09:00
Hiroshi SHIBATA ea517cfe23 skip lockfile_spec.rb:33 because it cleanup the .bundle repo 2020-05-13 07:54:37 +09:00
Hiroshi SHIBATA fcb5a9ee46 Resolved the file path of gemspec for ruby core repository 2020-05-13 07:54:37 +09:00
Hiroshi SHIBATA 5b634afe4c Added test_gems.rb for setup dependencies 2020-05-13 07:54:37 +09:00
Hiroshi SHIBATA 0e60b59d58 Update the bundler version with master branch 2020-05-13 07:54:37 +09:00
Hiroshi SHIBATA 7df6eaf29e
Addeed missing RSpec namespace 2020-05-09 16:58:21 +09:00
Kazuhiro NISHIYAMA 0a86679a7b
Fix a typo [ci skip] 2020-05-09 14:22:33 +09:00
Hiroshi SHIBATA b9031b1043 [rubygems/rubygems] Restore the old .gemrc example for compatible tests
https://github.com/rubygems/rubygems/commit/c45d65a06d
2020-05-08 14:13:29 +09:00
Benoit Daloze 5aaa75e7c1 Update to ruby/spec@032ee74 2020-05-03 12:28:29 +02:00
Benoit Daloze f646d20aae Update to ruby/mspec@d419d0b 2020-05-03 12:28:27 +02:00
Nobuyoshi Nakada 8af098b40e
Show unreserved bits only
`RUBY_FL_SEEN_OBJ_ID` can be set by #object_id.
2020-05-03 14:36:56 +09:00
Yusuke Endoh 224f29c8e9 spec/ruby/core/process/clock_getres_spec.rb: lax the resolution limit
Android is Linux, but the clock resolution is 10 milliseconds.
I think that 1 microsecond is too strict for embedded environment.
This change laxes the limit to 10 milliseconds.
2020-05-03 00:23:18 +09:00
Nobuyoshi Nakada 717680f197
DO NOT CORRUPT TYPE FLAGS 2020-05-03 00:11:47 +09:00
Nobuyoshi Nakada 9998161b10
Fixed missing `should` 2020-05-03 00:05:19 +09:00
Nobuyoshi Nakada e964f67b89
append newline at EOF [ci skip] 2020-05-02 23:15:00 +09:00
Nobuyoshi Nakada de8b8b609a
Command failed to run just fails
The exact exit status value of command failed to run is not a
spec, but a platform dependent implementation detail.  Just it is
not "success".
2020-05-02 23:11:42 +09:00
Benoit Daloze a2be428c5f Fix ObjectSpace::WeakMap#key? to work if the value is nil
* Fixes [Bug #16826]
2020-05-02 16:08:36 +02:00
Benoit Daloze c9213aa864 Update to ruby/spec@d394dfd 2020-05-02 16:03:14 +02:00
Benoit Daloze a68ddf4287 Update to ruby/mspec@ee29a34 2020-05-02 16:03:12 +02:00
Nobuyoshi Nakada 28aa5f7fa6
Fixed a message and version guard then moved to the existing block 2020-05-01 19:52:29 +09:00
Takashi Kokubun 773afeb73d
Fix a typo 2020-05-01 00:46:01 -07:00
Takashi Kokubun 76507bfc3d
Fix matrix spec for 7d360efe92 2020-05-01 00:45:17 -07:00
Nobuyoshi Nakada e801e9ba65
[ruby/spec] expand temporary directory to the real path
It may contain symbolic links.
2020-04-29 15:28:40 +09:00
Nobuyoshi Nakada 32e7d9140e
[ruby/spec] Temporary directories should be under the mock_dir 2020-04-29 15:28:40 +09:00
Nobuyoshi Nakada 86431f5075
Remove rubyspec temporary directories 2020-04-28 19:00:33 +09:00
Nobuyoshi Nakada d0f41aa238
[ruby/spec] Removed space between method name and argument list paren 2020-04-26 12:53:11 +09:00
Nobuyoshi Nakada 7860277527
[ruby/spec] Fixed missing should 2020-04-26 12:53:11 +09:00
Hiroshi SHIBATA 5c6269c459
Support XDG_* (#2174)
* Support XDG_CONFIG_HOME for gemrc.

* Support XDG_DATA_HOME for .gem

* Added test for XDG_DATA_HOME

* Do not reuse environmental variable.

* Unify .rdoc path to RDoc.home.

* Support XDG_DATA_HOME for .rdoc

* Ignore exists?

* Extracted config_home path

* Use XDG_CONFIG_HOME for default credential path

* Fixed inconsistency location.

* Fixed the broken tests.

* Support XDG_CONFIG_HOME for irbrc

* Introduce Gem.cache_home as XDG_CACHE_HOME

* Use Gem.cache_home instead of Gem.config_home for the credential file of RubyGems.

* Initialized the old configurations

* Fixed test failure related the configuration initialization

* restore XDG_DATA_HOME

* Fixed the broken examples of bundler with XDG_*

* Do not modify environmental variable on test file

* Use XDG_DATA_HOME insted of XDG_CACHE_HOME for credential file

* stub out Gem.data_home

* Move dir accessor to defaults.rb file

* Use XDG_DATA_HOME for signed gem features

* Use XDG_DATA_HOME for spec cache

* Do not rely on Gem.user_home

* Gem.user_home is always exists. Don't need to use FileUitls.mkdir_p

* Bump support version to RubyGems 3.2.0+

* Removed the needless fallback configuration

* Fixed the inconsistency methods that are find_config_file and config_file

* Use Gem.configuration.credentials_path instead of hard-coded path

* gem_path is always provided

* Removed the duplicated code of find_home

* Also removed the duplicated code of user_home

* use Gem::UNTAINT instead of untaint for surpressing the warnings

* Use File.directory

* Restore XDG_DATA_HOME

* Use File.write
2020-04-23 19:16:06 +09:00
Yusuke Endoh 2af4c1fc5b Skip Process#clock_getres specs on Android
... just like AIX and OpenBSD.
2020-04-19 23:15:43 +09:00
Nobuyoshi Nakada 62554ca978
Removed NIL/TRUE/FALSE
Deprerecated constants which had been warned since 2.4.
2020-04-17 17:35:17 +09:00
Nobuyoshi Nakada e8f53692ca
Endless method definition [Feature #16746] 2020-04-10 18:02:15 +09:00
Jeremy Evans 900e83b501 Turn class variable warnings into exceptions
This changes the following warnings:

* warning: class variable access from toplevel
* warning: class variable @foo of D is overtaken by C

into RuntimeErrors.  Handle defined?(@@foo) at toplevel
by returning nil instead of raising an exception (the previous
behavior warned before returning nil when defined? was used).

Refactor the specs to avoid the warnings even in older versions.
The specs were checking for the warnings, but the purpose of
the related specs as evidenced from their description is to
test for behavior, not for warnings.

Fixes [Bug #14541]
2020-04-10 00:29:05 -07:00
Nobuyoshi Nakada d8720eb7de
Suppress -Wshorten-64-to-32 warnings 2020-04-08 16:28:38 +09:00
卜部昌平 9e6e39c351
Merge pull request #2991 from shyouhei/ruby.h
Split ruby.h
2020-04-08 13:28:13 +09:00
Nobuyoshi Nakada a58bbd6a51
Use `rb_warn_deprecated` for `File.exists?` and `Dir.exists?` 2020-04-06 21:43:32 +09:00
Nobuyoshi Nakada 146330906f
Fixed the location of the shared library
On platform where searchs shared libraries by `PATH` environment
variable (i.e., Windows), the shared library is installed in
`bindir`.  On other platforms, the library directory is directed
by `libdirname` indirectly.
2020-04-04 11:18:25 +09:00
Nobuyoshi Nakada 4a71645565
rbconfig_spec.rb: removed needless windows guard
This reverts commit 34b0a7be0e.
2020-04-04 11:18:23 +09:00
Benoit Daloze 7f82c8cd47 Update to ruby/spec@7289ea3 2020-04-04 01:02:53 +02:00
Benoit Daloze da5a128991 Update to ruby/mspec@fad32a5 2020-04-04 01:02:50 +02:00
Nobuyoshi Nakada ca0f68260e
Use `platform_is` guard 2020-04-03 09:47:19 +09:00
Nobuyoshi Nakada 18f7d3c9a6
Refined "Drop support for ruby 2.4 from ruby/spec"
By using spec/mspec/tool/remove_old_guards.rb.
2020-04-03 09:44:40 +09:00
Nobuyoshi Nakada f49a24201c
Refined spec/mspec/tool/remove_old_guards.rb
* Allow spaces around `...`
* Matches quotes more precisely
* Matches 0 teeny
2020-04-03 09:44:32 +09:00
Benoit Daloze da05c1552e Update to ruby/spec@cc7b9e5 2020-04-02 22:39:28 +02:00
Benoit Daloze 4ec32f869f Update to ruby/mspec@b9fe8d6 2020-04-02 22:39:26 +02:00
Nobuyoshi Nakada 242e58db2f
Removed obsolete names 2020-04-03 01:16:57 +09:00
Nobuyoshi Nakada 826f44834f Drop support for ruby 2.4 from ruby/spec 2020-04-01 15:36:20 +09:00
Nobuyoshi Nakada 3a2073e61b Use FrozenError instead of frozen_error_class 2020-04-01 15:36:20 +09:00
Yusuke Endoh 87aebecdc2 spec/ruby/core/time/: Use near time for timezone test
`time_with_zone.zone.should == (time_with_zone - 60*60).zone` fails when
the time is immediately before the change of summer time.

https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11s/ruby-master/log/20200328T232504Z.fail.html.gz

```
1)
Time#+ preserves time zone FAILED
Expected "CET" == "CEST"
to be truthy but was false
```

It is acceptable as it fails at most twice per year, but it would be
good to use near time objects to reduce the possibility.
2020-03-29 10:06:53 +09:00
Yusuke Endoh 6379c6af4d spec/bundler/other/platform_spec.rb: skip an attempt to simulate JRuby 2020-03-29 09:09:46 +09:00
Takashi Kokubun cf191872fd
Increase the number of Process.times attempts
CI of 5806c54447 did not succeed
https://travis-ci.org/github/ruby/ruby/jobs/668072714
2020-03-28 15:23:30 -07:00
Benoit Daloze 5806c54447 Improve reliability of the Process.times spec 2020-03-28 14:39:01 +01:00
Benoit Daloze 6413a26b6c Do not check that #stime changes in Process.times spec
* Since the spec might not spend any time in system calls.
2020-03-28 14:32:22 +01:00
Benoit Daloze 11a381940b Remove debugging code 2020-03-28 14:27:13 +01:00
Benoit Daloze 5b48686691 Remove Process.clock_getres "matches the resolution in practice" specs
* Almost all platforms return incorrect values for Process.clock_getres,
  it should be removed: https://bugs.ruby-lang.org/issues/16740
2020-03-28 12:49:28 +01:00
Benoit Daloze 282c9d1bbe Remove spec which is an incorrect usage of rb_rescue2()
* It segfaults on MRI.
2020-03-28 12:34:45 +01:00
Yusuke Endoh 34b0a7be0e spec/ruby/library/rbconfig/rbconfig_spec.rb: restore "not windows" guard
https://github.com/ruby/ruby/runs/541455267
```
1)
RbConfig::CONFIG libdir/LIBRUBY_SO is the path to libruby and it exists if and only if ENABLE_SHARED FAILED
Expected File.exist? "d:/Ruby26-x64/lib/x64-msvcrt-ruby260.dll"
to be truthy but was false
D:/a/ruby/ruby/src/spec/ruby/library/rbconfig/rbconfig_spec.rb:46:in `block (3 levels) in <top (required)>'
D:/a/ruby/ruby/src/spec/ruby/library/rbconfig/rbconfig_spec.rb:4:in `<top (required)>'
```
2020-03-28 19:31:11 +09:00
Nobuyoshi Nakada 8c80922c82
Fixed RbConfig spec for multiarch 2020-03-28 16:27:01 +09:00
Nobuyoshi Nakada 7072e0324e
Guard RbConfig spec unless installed 2020-03-28 14:57:17 +09:00
Yusuke Endoh 6eb3820aad spec/ruby/optional/capi/kernel_spec.rb: stop a spec that causes SEGV
I think the wrong terminating argument cannot work.
To stop the noisy CI failures, the spec is tentatively suspended.
2020-03-28 11:12:30 +09:00
Benoit Daloze f234d51eab Update to ruby/spec@ec84479 2020-03-28 00:22:51 +01:00
Benoit Daloze 296f68816c Update to ruby/mspec@16b5a0a 2020-03-28 00:22:48 +01:00
Nobuyoshi Nakada f6b6a7ad34
Show failed times 2020-03-24 14:56:03 +09:00
Takashi Kokubun eff0c5bf2a
Try to avoid random failures on clock_getres_spec.rb
This spec fails too often
https://github.com/ruby/ruby/runs/529546249
https://github.com/ruby/ruby/runs/524933256
2020-03-23 22:53:54 -07:00
Jeremy Evans 4f7b435c95 Support obj.clone(freeze: true) for freezing clone
This freezes the clone even if the receiver is not frozen.  It
is only for consistency with freeze: false not freezing the clone
even if the receiver is frozen.

Because Object#clone is now partially implemented in Ruby and
not fully implemented in C, freeze: nil must be supported to
provide the default behavior of only freezing the clone if the
receiver is frozen.

This requires modifying delegate and set, to set freeze: nil
instead of freeze: true as the keyword parameter for
initialize_clone.  Those are the two libraries in stdlib that
override initialize_clone.

Implements [Feature #16175]
2020-03-22 09:30:07 -07:00
Nobuyoshi Nakada 5b287481be
Removed non-RUBY_INTEGER_UNIFICATION code 2020-03-21 16:59:55 +09:00
Yusuke Endoh d514ba8e17 `Proc` made by `Hash#to_proc` should be a lambda [Bug #12671]
Like `Symbol#to_proc` (f0b815dc67)
2020-03-16 23:38:26 +09:00
Yusuke Endoh 47141797be hash.c: Do not use the fast path (rb_yield_values) for lambda blocks
As a semantics, Hash#each yields a 2-element array (pairs of keys and
values).  So, `{ a: 1 }.each(&->(k, v) { })` should raise an exception
due to lambda's arity check.
However, the optimization that avoids Array allocation by using
rb_yield_values for blocks whose arity is more than 1 (introduced at
b9d2960337 and some commits), seemed to
overlook the lambda case, and wrongly allowed the code above to work.

This change experimentally attempts to make it strict; now the code
above raises an ArgumentError.  This is an incompatible change; if the
compatibility issue is bigger than our expectation, it may be reverted
(until Ruby 3.0 release).

[Bug #12706]
2020-03-16 23:17:12 +09:00
Nobuyoshi Nakada f14409c9bb
Enclosed version constant 2020-03-15 22:21:23 +09:00
Nobuyoshi Nakada 1ad9b231ca
Added guard against [Bug #16497] 2020-03-15 22:15:39 +09:00
Jean Boussier e257c08f2e
[ruby/stringio] StringIO#initialize default to the source string encoding
[Bug #16497]

https://github.com/ruby/stringio/commit/4958a5ccab
2020-03-15 18:43:01 +09:00
Yusuke Endoh c6633f21a4 Update some syslog tests to absurb the format change of FreeBSD syslog
FreeBSD

```
$ ruby -rsyslog -e 'Syslog.open("rubyspec", Syslog::LOG_PERROR) {|s| s.log(Syslog::LOG_ALERT, "Hello") }'
rubyspec 78462 - - Hello
```

Linux

```
$ ruby -rsyslog -e 'Syslog.open("rubyspec", Syslog::LOG_PERROR) {|s| s.log(Syslog::LOG_ALERT, "Hello") }'
rubyspec: Hello
```

591ef7c807
2020-03-12 15:30:20 +09:00
Nobuyoshi Nakada 2fd779fcd9
Added version guard for OpenSSL::Config 2020-03-10 21:47:18 +09:00
Jeremy Evans e02bd0e713
Don't display singleton class in Method#inspect unless method defined there
Previously, if an object has a singleton class, and you call
Object#method on the object, the resulting string would include
the object's singleton class, even though the method was not
defined in the singleton class.

Change this so the we only show the singleton class if the method
is defined in the singleton class.

Fixes [Bug #15608]
2020-03-09 07:57:16 -07:00
Jeremy Evans f4394bbca3 Do not autosplat when calling procs that accept rest and keywords
When providing a single array to a block that takes a splat, pass the
array as one argument of the splat instead of as the splat itself,
even if the block also accepts keyword arguments.  Previously, this
behavior was only used for blocks that did not accept keywords.

Implements [Feature#16166]
2020-03-08 20:49:09 -07:00
Nobuyoshi Nakada 108f7536b3
Removed unnecessary `chomp`
As `String#split` with the default argument drops trailing newline
as a separator, preceding `String#chomp` is futile.
2020-03-07 17:04:37 +09:00
Kazuhiro NISHIYAMA fcd605020b
Fix a typo 2020-03-07 13:49:28 +09:00
Yusuke Endoh 17d5efa4fe spec/ruby/core/process/exec_spec.rb: remove a guard for openbsd
openbsd current seems to behave the same as other OSs.

https://rubyci.org/logs/rubyci.s3.amazonaws.com/openbsd-current/ruby-master/log/20200305T063005Z.fail.html.gz
2020-03-05 18:25:47 +09:00
Nobuyoshi Nakada af1863734c
Adjust types 2020-02-29 21:42:38 +09:00
dependabot[bot] 02a3e27608
Bump rake from 10.5.0 to 12.3.3 in /spec/mspec (#2942)
Bumps [rake](https://github.com/ruby/rake) from 10.5.0 to 12.3.3.
- [Release notes](https://github.com/ruby/rake/releases)
- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rake/compare/v10.5.0...v12.3.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-02-28 10:13:28 -08:00
Benoit Daloze a0f5ff4c3c Update to ruby/spec@41bf282 2020-02-28 19:07:17 +01:00
Benoit Daloze 5d21050182 Update to ruby/mspec@a514ad7 2020-02-28 19:07:14 +01:00
Jeremy Evans 54499d7810 Remove support for passing nil to IO#ungetc
Fixes [Bug #13675]
2020-02-27 10:17:54 -08:00
Nobuyoshi Nakada 8a7e0aaaef
Warn non-nil `$/` [Feature #14240] 2020-02-23 13:37:40 +09:00
Nobuyoshi Nakada 6298ec2875
Warn non-nil `$\` [Feature #14240] 2020-02-23 13:37:40 +09:00
Benoit Daloze 4aebb49153 Expand Symbol#to_proc specs to be clearer 2020-02-22 14:43:52 +01:00
Nobuyoshi Nakada 5b29ea0845
Proc from Symbol needs a receiver
So its arity should be -2 instead of -1.

[Bug #16640]
https://bugs.ruby-lang.org/issues/16640#change-84337
2020-02-22 10:49:59 +09:00
Nobuyoshi Nakada f0b815dc67
`Proc` made by `Symbol#to_proc` should be a lambda [Bug #16260] 2020-02-19 15:46:26 +09:00
Yusuke Endoh 6bfc576271 spec/ruby/library/socket/constants/constants_spec.rb: skip on Android
IP_MAX_MEMBERSHIPS seems not to be defined on Android
2020-02-13 23:16:10 +09:00
Yusuke Endoh bbc6799334 spec/ruby/library/socket/addrinfo/getnameinfo_spec.rb: skip on Android
FreeBSD's GETNAMEINFO(3) says:

> If a link-layer address or UNIX-domain address is passed to
> getnameinfo(), its ASCII representation will be stored in host.  The
> string pointed to by serv will be set to the empty string if non-NULL;
> flags will always be ignored.

Android seems to behave like FreeBSD.
2020-02-13 23:13:17 +09:00
Yusuke Endoh 09a042ae04 spec/ruby/library/etc/: skip the specs related to group on Android
User/group system on Android seems different from normal Linux.
2020-02-13 23:11:28 +09:00