aboutsummaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* Removed non-RUBY_INTEGER_UNIFICATION codeNobuyoshi Nakada2020-03-211-18/+0
|
* `Proc` made by `Hash#to_proc` should be a lambda [Bug #12671]Yusuke Endoh2020-03-161-2/+10
| | | | Like `Symbol#to_proc` (f0b815dc670b61eba1daaa67a8613ac431d32b16)
* hash.c: Do not use the fast path (rb_yield_values) for lambda blocksYusuke Endoh2020-03-161-10/+28
| | | | | | | | | | | | | | | | | 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]
* Enclosed version constantNobuyoshi Nakada2020-03-151-3/+5
|
* Added guard against [Bug #16497]Nobuyoshi Nakada2020-03-151-1/+23
|
* [ruby/stringio] StringIO#initialize default to the source string encodingJean Boussier2020-03-151-0/+3
| | | | | | [Bug #16497] https://github.com/ruby/stringio/commit/4958a5ccab
* Update some syslog tests to absurb the format change of FreeBSD syslogYusuke Endoh2020-03-122-7/+6
| | | | | | | | | | | | | | | | | | 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 ``` https://github.com/freebsd/freebsd/commit/591ef7c8076109cff3c41f9bb50da996a34121e9
* Added version guard for OpenSSL::ConfigNobuyoshi Nakada2020-03-102-12/+31
|
* Don't display singleton class in Method#inspect unless method defined thereJeremy Evans2020-03-091-0/+18
| | | | | | | | | | | 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]
* Do not autosplat when calling procs that accept rest and keywordsJeremy Evans2020-03-081-11/+20
| | | | | | | | | 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]
* Removed unnecessary `chomp`Nobuyoshi Nakada2020-03-071-1/+1
| | | | | As `String#split` with the default argument drops trailing newline as a separator, preceding `String#chomp` is futile.
* Fix a typoKazuhiro NISHIYAMA2020-03-071-1/+1
|
* spec/ruby/core/process/exec_spec.rb: remove a guard for openbsdYusuke Endoh2020-03-051-10/+2
| | | | | | 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
* Adjust typesNobuyoshi Nakada2020-02-291-2/+1
|
* Bump rake from 10.5.0 to 12.3.3 in /spec/mspec (#2942)dependabot[bot]2020-02-282-3/+3
| | | | | | | | 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>
* Update to ruby/spec@41bf282Benoit Daloze2020-02-2875-143/+851
|
* Update to ruby/mspec@a514ad7Benoit Daloze2020-02-284-8/+7
|
* Remove support for passing nil to IO#ungetcJeremy Evans2020-02-271-4/+13
| | | | Fixes [Bug #13675]
* Warn non-nil `$/` [Feature #14240]Nobuyoshi Nakada2020-02-2314-25/+42
|
* Warn non-nil `$\` [Feature #14240]Nobuyoshi Nakada2020-02-236-20/+29
|
* Expand Symbol#to_proc specs to be clearerBenoit Daloze2020-02-221-10/+32
|
* Proc from Symbol needs a receiverNobuyoshi Nakada2020-02-221-4/+6
| | | | | | | So its arity should be -2 instead of -1. [Bug #16640] https://bugs.ruby-lang.org/issues/16640#change-84337
* `Proc` made by `Symbol#to_proc` should be a lambda [Bug #16260]Nobuyoshi Nakada2020-02-191-1/+1
|
* spec/ruby/library/socket/constants/constants_spec.rb: skip on AndroidYusuke Endoh2020-02-131-1/+1
| | | | IP_MAX_MEMBERSHIPS seems not to be defined on Android
* spec/ruby/library/socket/addrinfo/getnameinfo_spec.rb: skip on AndroidYusuke Endoh2020-02-131-10/+12
| | | | | | | | | | | 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.
* spec/ruby/library/etc/: skip the specs related to group on AndroidYusuke Endoh2020-02-132-2/+2
| | | | User/group system on Android seems different from normal Linux.
* spec/ruby/library/socket/addrinfo: skip the specs that uses SOCK_SEQPACKET ↵Yusuke Endoh2020-02-131-23/+27
| | | | | | on Android SOCK_SEQPACKET seems not to be supported on Android
* spec/ruby/library/syslog: skip the specs that use LOG_PERROR on AndroidYusuke Endoh2020-02-132-2/+2
| | | | | LOG_PERROR is defined on Android, but not implemented yet. See also f3c4e620ac612eab6370b1fb82feaa4e651542bb.
* spec/ruby: skip the specs that use /etc/passwd on AndroidYusuke Endoh2020-02-134-4/+7
| | | | There is no /etc/passwd on Android
* spec/ruby/library/etc/confstr_spec.rb: skip on AndroidYusuke Endoh2020-02-131-1/+1
| | | | There seems to be no _CS_PATH on Android.
* spec/ruby/core/process/spawn_spec.rb: Use / instead of /tmpYusuke Endoh2020-02-131-1/+1
| | | | because there is no /tmp on Android.
* spec/ruby/core/process/clock_getres_spec.rb: skip on AndroidYusuke Endoh2020-02-131-1/+1
| | | | | in the same way as FreeBSD and OpenBSD. I guess that the spec makes too strong assumption.
* spec/ruby/core/encoding/locale_charmap_spec.rb: locale_charmap is UTF-8 on ↵Yusuke Endoh2020-02-131-5/+16
| | | | | | | Android nl_langinfo(CODESET) always returns UTF-8 on Android, regardless to LC_ALL=C.
* spec/ruby/core/dir/home_spec.rb: exclude AndroidYusuke Endoh2020-02-131-1/+1
| | | | | I couldn't find a robust way to get the home path except ENV["HOME"] on Android Termux.
* Make yield in singleton class definitions in methods a SyntaxErrorJeremy Evans2020-02-111-1/+9
| | | | | | | | 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.
* Removed a useless guardNobuyoshi Nakada2020-02-091-1/+1
| | | | MSpec requires Ruby 2.4 or more recent.
* spec/ruby/core/file/utime_spec.rb: far future timestamp may be trancatedYusuke Endoh2020-02-091-3/+5
| | | | | | | | | | | | | | | | | | 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
* [DOC] Added 2.7.x to the latest stable versions [ci skip]Nobuyoshi Nakada2020-02-081-1/+1
|
* [ruby/spec] Don't care about return valuesNobuyoshi Nakada2020-02-063-57/+4
| | | | | | RDoc says nothing about them. Added an example that ConditionVariable#wait can be woken up by ConditionVariable#signal, instead.
* [ruby/spec] Just test that sleep completesNobuyoshi Nakada2020-02-061-1/+1
|
* [ruby/spec] Check by Thread#stop?Nobuyoshi Nakada2020-02-065-16/+24
| | | | | Check if threads are stopped by Thread#stop? instead of the status name.
* Update to ruby/spec@f8a2d54Benoit Daloze2020-01-2876-224/+2451
|
* Update to ruby/mspec@9bce874Benoit Daloze2020-01-283-1/+11
|
* Fix some spec breakage on 2.7 related to keyword argumentsJeremy Evans2020-01-281-11/+21
| | | | | | | These specs were probably added in the commit to fully separate keyword arguments after the release of 2.7.0, but apparently not tested on 2.7 before hand. The enclosing ruby_version guard for these specs limits them to 2.7.
* Run specs against the latest release of 2.4Benoit Daloze2020-01-281-1/+1
|
* Fix version guard in __dir__ specBenoit Daloze2020-01-281-2/+2
|
* Removed useless "spec"sNobuyoshi Nakada2020-01-272-29/+0
| | | | | It is not specific to particular methods that keyword option arguments are coerced to `Hash`es using `to_hash` method.
* Moved Array#sample to rbincNobuyoshi Nakada2020-01-261-13/+16
|
* Moved Array#shuffle and Array#shuffle! to rbincNobuyoshi Nakada2020-01-261-4/+7
|
* spec/ruby/core/process/times_spec.rb: add an output code for debuggingYusuke Endoh2020-01-251-1/+8
|