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

1217 Коммитов

Автор SHA1 Сообщение Дата
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
Yusuke Endoh db8c8c0916 spec/ruby/library/socket/addrinfo: skip the specs that uses SOCK_SEQPACKET on Android
SOCK_SEQPACKET seems not to be supported on Android
2020-02-13 23:10:03 +09:00
Yusuke Endoh 89bfad17d5 spec/ruby/library/syslog: skip the specs that use LOG_PERROR on Android
LOG_PERROR is defined on Android, but not implemented yet.
See also f3c4e620ac.
2020-02-13 23:08:31 +09:00
Yusuke Endoh c6ebbbd38b spec/ruby: skip the specs that use /etc/passwd on Android
There is no /etc/passwd on Android
2020-02-13 23:06:33 +09:00
Yusuke Endoh ca53ab581b spec/ruby/library/etc/confstr_spec.rb: skip on Android
There seems to be no _CS_PATH on Android.
2020-02-13 23:04:15 +09:00
Yusuke Endoh 02233e171c spec/ruby/core/process/spawn_spec.rb: Use / instead of /tmp
because there is no /tmp on Android.
2020-02-13 23:03:07 +09:00
Yusuke Endoh ed549f80b6 spec/ruby/core/process/clock_getres_spec.rb: skip on Android
in the same way as FreeBSD and OpenBSD.
I guess that the spec makes too strong assumption.
2020-02-13 23:00:30 +09:00
Yusuke Endoh 022268ae00 spec/ruby/core/encoding/locale_charmap_spec.rb: locale_charmap is UTF-8 on Android
nl_langinfo(CODESET) always returns UTF-8 on Android, regardless to
LC_ALL=C.
2020-02-13 23:00:03 +09:00
Yusuke Endoh a11fa7d8cd spec/ruby/core/dir/home_spec.rb: exclude Android
I couldn't find a robust way to get the home path except ENV["HOME"] on
Android Termux.
2020-02-13 22:56:42 +09:00
Jeremy Evans 7a288df7b8 Make yield in singleton class definitions in methods a SyntaxError
This behavior was deprecated in 2.7 and scheduled to be removed
in 3.0.

Calling yield in a class definition outside a method is now a
SyntaxError instead of a LocalJumpError, as well.
2020-02-11 12:44:23 -08:00
Nobuyoshi Nakada 92c86e39de
Removed a useless guard
MSpec requires Ruby 2.4 or more recent.
2020-02-09 12:13:28 +09:00
Yusuke Endoh 2173ae7801 spec/ruby/core/file/utime_spec.rb: far future timestamp may be trancated
Under some Ext4 filesystem settings, a timestamp is limited up to
0x37fffffff (2446-05-10).

https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Inode_Timestamps
> Therefore, timestamps should not overflow until May 2446.

Actually the spec fails under one of our CI environments, like:

```
1)
File.utime allows Time instances in the far future to set mtime and atime FAILED
Expected 2446 == 559444
to be truthy but was false
```
https://rubyci.org/logs/rubyci.s3.amazonaws.com/arch/ruby-master/log/20200208T180002Z.fail.html.gz
2020-02-09 11:13:06 +09:00
Nobuyoshi Nakada 80cbf97918
[DOC] Added 2.7.x to the latest stable versions [ci skip] 2020-02-08 19:48:31 +09:00
Nobuyoshi Nakada 739fdb7ff0
[ruby/spec] Don't care about return values
RDoc says nothing about them.  Added an example that
ConditionVariable#wait can be woken up by
ConditionVariable#signal, instead.
2020-02-06 15:42:36 +09:00
Nobuyoshi Nakada 32adae431d
[ruby/spec] Just test that sleep completes 2020-02-06 15:42:16 +09:00
Nobuyoshi Nakada 3d83e641b1
[ruby/spec] Check by Thread#stop?
Check if threads are stopped by Thread#stop? instead of the status
name.
2020-02-06 14:50:32 +09:00
Benoit Daloze 809f0b8a13 Update to ruby/spec@f8a2d54 2020-01-28 20:47:48 +01:00
Benoit Daloze ed377cc9aa Update to ruby/mspec@9bce874 2020-01-28 20:47:46 +01:00