summaryrefslogtreecommitdiff
path: root/spec/ruby/core
AgeCommit message (Collapse)Author
2020-04-29[ruby/spec] Temporary directories should be under the mock_dirNobuyoshi Nakada
2020-04-19Skip Process#clock_getres specs on AndroidYusuke Endoh
... just like AIX and OpenBSD.
2020-04-10Turn class variable warnings into exceptionsJeremy Evans
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] Notes: Merged: https://github.com/ruby/ruby/pull/2987
2020-04-06Use `rb_warn_deprecated` for `File.exists?` and `Dir.exists?`Nobuyoshi Nakada
2020-04-04Update to ruby/spec@7289ea3Benoit Daloze
2020-04-03Use `platform_is` guardNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2997
2020-04-03Refined "Drop support for ruby 2.4 from ruby/spec"Nobuyoshi Nakada
By using spec/mspec/tool/remove_old_guards.rb. Notes: Merged: https://github.com/ruby/ruby/pull/2997
2020-04-02Update to ruby/spec@cc7b9e5Benoit Daloze
2020-04-01Drop support for ruby 2.4 from ruby/specNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2892
2020-04-01Use FrozenError instead of frozen_error_classNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2892
2020-03-29spec/ruby/core/time/: Use near time for timezone testYusuke Endoh
`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-28Increase the number of Process.times attemptsTakashi Kokubun
CI of 5806c54447439f2ba22892e4045e78dd80f96f0c did not succeed https://travis-ci.org/github/ruby/ruby/jobs/668072714
2020-03-28Improve reliability of the Process.times specBenoit Daloze
2020-03-28Do not check that #stime changes in Process.times specBenoit Daloze
* Since the spec might not spend any time in system calls.
2020-03-28Remove debugging codeBenoit Daloze
2020-03-28Remove Process.clock_getres "matches the resolution in practice" specsBenoit Daloze
* Almost all platforms return incorrect values for Process.clock_getres, it should be removed: https://bugs.ruby-lang.org/issues/16740
2020-03-28Update to ruby/spec@ec84479Benoit Daloze
2020-03-24Show failed timesNobuyoshi Nakada
2020-03-23Try to avoid random failures on clock_getres_spec.rbTakashi Kokubun
This spec fails too often https://github.com/ruby/ruby/runs/529546249 https://github.com/ruby/ruby/runs/524933256
2020-03-22Support obj.clone(freeze: true) for freezing cloneJeremy Evans
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] Notes: Merged: https://github.com/ruby/ruby/pull/2969
2020-03-16`Proc` made by `Hash#to_proc` should be a lambda [Bug #12671]Yusuke Endoh
Like `Symbol#to_proc` (f0b815dc670b61eba1daaa67a8613ac431d32b16)
2020-03-16hash.c: Do not use the fast path (rb_yield_values) for lambda blocksYusuke Endoh
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 b9d29603375d17c3d1d609d9662f50beaec61fa1 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-09Don't display singleton class in Method#inspect unless method defined thereJeremy Evans
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] Notes: Merged: https://github.com/ruby/ruby/pull/2949 Merged-By: jeremyevans <code@jeremyevans.net>
2020-03-05spec/ruby/core/process/exec_spec.rb: remove a guard for openbsdYusuke Endoh
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-02-28Update to ruby/spec@41bf282Benoit Daloze
2020-02-27Remove support for passing nil to IO#ungetcJeremy Evans
Fixes [Bug #13675] Notes: Merged: https://github.com/ruby/ruby/pull/2935
2020-02-23Warn non-nil `$/` [Feature #14240]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2920
2020-02-23Warn non-nil `$\` [Feature #14240]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2920
2020-02-22Expand Symbol#to_proc specs to be clearerBenoit Daloze
2020-02-22Proc from Symbol needs a receiverNobuyoshi Nakada
So its arity should be -2 instead of -1. [Bug #16640] https://bugs.ruby-lang.org/issues/16640#change-84337
2020-02-19`Proc` made by `Symbol#to_proc` should be a lambda [Bug #16260]Nobuyoshi Nakada
2020-02-13spec/ruby: skip the specs that use /etc/passwd on AndroidYusuke Endoh
There is no /etc/passwd on Android
2020-02-13spec/ruby/core/process/spawn_spec.rb: Use / instead of /tmpYusuke Endoh
because there is no /tmp on Android.
2020-02-13spec/ruby/core/process/clock_getres_spec.rb: skip on AndroidYusuke Endoh
in the same way as FreeBSD and OpenBSD. I guess that the spec makes too strong assumption.
2020-02-13spec/ruby/core/encoding/locale_charmap_spec.rb: locale_charmap is UTF-8 on ↵Yusuke Endoh
Android nl_langinfo(CODESET) always returns UTF-8 on Android, regardless to LC_ALL=C.
2020-02-13spec/ruby/core/dir/home_spec.rb: exclude AndroidYusuke Endoh
I couldn't find a robust way to get the home path except ENV["HOME"] on Android Termux.
2020-02-09spec/ruby/core/file/utime_spec.rb: far future timestamp may be trancatedYusuke Endoh
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-06[ruby/spec] Just test that sleep completesNobuyoshi Nakada
2020-02-06[ruby/spec] Check by Thread#stop?Nobuyoshi Nakada
Check if threads are stopped by Thread#stop? instead of the status name.
2020-01-28Update to ruby/spec@f8a2d54Benoit Daloze
2020-01-28Fix version guard in __dir__ specBenoit Daloze
2020-01-27Removed useless "spec"sNobuyoshi Nakada
It is not specific to particular methods that keyword option arguments are coerced to `Hash`es using `to_hash` method.
2020-01-26Moved Array#sample to rbincNobuyoshi Nakada
2020-01-26Moved Array#shuffle and Array#shuffle! to rbincNobuyoshi Nakada
2020-01-25spec/ruby/core/process/times_spec.rb: add an output code for debuggingYusuke Endoh
2020-01-15Update version guardKazuhiro NISHIYAMA
fix up 98ef38ada43338c073f50a0093196f0356284625
2020-01-15Freeze Regexp literalsJean Boussier
[Feature #8948] [Feature #16377] Since Regexp literals always reference the same instance, allowing to mutate them can lead to state leak. Notes: Merged: https://github.com/ruby/ruby/pull/2705
2020-01-09Include the standard `id` command outputNobuyoshi Nakada
On macOS, GNU coreutils `id` is limited to NGROUPS_MAX groups, because of the backward compatibility of getgroups(2).
2020-01-03Make eval(code, binding) use (eval) as __FILE__ and 1 as __LINE__Jeremy Evans
This removes the warning that was added in 3802fb92ff8c83eed3e867db20f72c53932f542d, and switches the behavior so that the eval does not use the binding's __FILE__ and __LINE__ implicitly. Fixes [Bug #4352] Notes: Merged: https://github.com/ruby/ruby/pull/2816
2020-01-02Update specs for keyword argument separationJeremy Evans
Notes: Merged: https://github.com/ruby/ruby/pull/2794