summaryrefslogtreecommitdiff
path: root/spec/ruby
AgeCommit message (Collapse)Author
2018-07-02merge revision(s) 62731,62735: [Backport #14495]nagachika
Bug Fix Enumerator::Lazy#uniq state for multiple call * enumerator.c (lazy_uniq_i): create new hash for each calls. [Fix GH-1820] Currently 2.5.0-preview1 :001 > arr = (0..100).lazy.uniq{|i| i % 10} => #<Enumerator::Lazy: #<Enumerator::Lazy: 0..100>:uniq> 2.5.0-preview1 :002 > arr.to_a => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] 2.5.0-preview1 :003 > arr.to_a => [] Expected arr.to_a to always return same output From: Anmol Chopra <anmolchopra@rocketbox.in> test_enumerator.rb: duplicate assertions * test/ruby/test_enumerator.rb (test_uniq): remove assertions which ared duplicate of lazy enumerator tests in test_lazy_enumerator.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@63824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-22merge revision(s) 62042,62044: [Backport #14380]naruse
hash.c: support key swapping in Hash#transform_keys! * hash.c (rb_hash_transform_keys_bang): support key swapping in Hash#transform_keys! [Bug #14380] [ruby-core:84951] * test/ruby/test_hash.rb (test_transform_keys_bang): add assertions for this change Fix rubyspec against the change in Hash#transform_keys! [Bug #14380] [ruby-core:84951] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@62889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-20merge revision(s) 62725: [Backport #14604]naruse
Fix setting method visibility on method wrapped with prepend Ignore prepended modules when looking for already defined methods on a class to set the visibility on. [Fix GH-1834] From: Dylan Thacker-Smith <Dylan.Smith@shopify.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@62860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-26merge revision(s) 62094,62584: [Backport #14407]naruse
Merge ruby/spec@fd56cd4 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@62586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-25merge revision(s) 62071: [Backport #14407]naruse
defined? returns nil for toplevel constant lookup * variable.c (rb_const_defined_0): toplevel constant lookup has been removed, should return nil too. [ruby-core:85142] [Bug #14407] [Fix GH-1800] From: Gonzalo <grzuy0@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@62568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21Simplify Thread#[]= speceregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20fix threading bug.ko1
* spec/ruby/core/thread/element_set_spec.rb: `t` can be uninitialized. Use `Thread.current` explicitly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-18Use syswrite to avoid potential buffering in IO#select speceregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-17Integer#{any|all|no}_bits: Fix coercion. Add specs [#12753]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-15Update to ruby/spec@595645feregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-14The main Thread should have report_on_exception=true for consistencyeregon
* Adapt test and add specs. * See [Feature #14143] [ruby-core:84227] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Set Thread.report_on_exception=true by default to report exceptions in Threadseregon
* [Feature #14143] [ruby-core:83979] * vm.c (vm_init2): Set Thread.report_on_exception to true. * thread.c (thread_start_func_2): Add indication the message is caused by report_on_exception = true. * spec/ruby: Specify the new behavior. * test/ruby/test_thread.rb: Adapt and improve tests for Thread.report_on_exception and Thread#report_on_exception. * test/ruby/test_thread.rb, test/ruby/test_exception.rb: Unset report_on_exception for tests expecting no extra output. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12ignore lines (to catch up r61155).ko1
* spec/ruby/library/net/ftp/return_code_spec.rb: check message body only. * spec/ruby/library/net/http/http/set_debug_output_spec.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12struct.c: add keyword_init option to Struct.newk0kubun
to initialize struct with keyword arguments. [Feature #11925] [close GH-1771] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12catch up r61131.ko1
* spec/ruby/core/kernel/autoload_spec.rb: should use FrozenError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-10Add case equality arity to Enumerable#all?, any?, none? and one?,marcandre
and specialized Array#any? and Hash#any? Based on patch by D.E. Akers [#11286] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01Update to ruby/spec@e2d0d1eeregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01* append newline at EOF.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01Update to ruby/spec@bacedc5eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-29Cherrypick 9f8d3d0 from ruby/specmarcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-29spec/ruby/optional/capi/constants_spec.rb: Data is deprecated nownobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-19* append newline at EOF.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-19Add specs for concurrent Module#autoloaderegon
* When the file does not exist or the constant is not set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-19Reorganize Module#autoload to have similar specs next to each othereregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-16parse.y: no return in classnobu
* parse.y (k_return): prohibit return in class/module body except for singleton class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-04Workaround Travis CI issue by hardcoding localhosteregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-04load from relative path to __FILE__nobu
* spec/ruby/library/pathname/empty_spec.rb: load spec_helper from relative path to `__FILE__` same as other spec files, instead of `__dir__` in which symlinks are resolved, to get rid of constant redefinition warning when `srcdir` contains symlinks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-30stop refine_spec because it causes double free errorko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29Clarify what is written and read in IO#popen speceregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29Fix spec which can fail if the pipe is closed before flushing in the subprocesseregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28Ignore the libruby check if it cannot be founderegon
* ENV['RUBY_EXE'] can be just 'ruby' and is not an absolute path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28Make sure to compile each extension only once in ruby/speceregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28Use ENV['RUBY_EXE'] as RbConfig.ruby might be incorrecteregon
* On a built-but-not-installed-ruby. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28* append newline at EOF.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28Update to ruby/spec@a6b8805eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28Add specs for [Feature #13983] Rational and Complex should be frozeneregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27Revert "Dir.glob with FNM_EXTGLOB is optimized [Feature #13873]"naruse
This reverts commit r60341,r60342,r60344,r60345. Breaking compabitility of the order of result breaks many tests. To avoid such effort to fix tests, the order should be kept. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27Fix typoa_matsuda
Patch by: 284km <k.furuhashi10@gmail.com> https://github.com/ruby/ruby/pull/1729 [Fix GH-1729] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25io.c: write a newline togethernobu
* io.c (rb_io_puts): write a newline together at once for each argument. based on the patch by rohitpaulk (Rohit Kuruvilla) at [ruby-core:83508]. [Feature #14042] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Dir.glob with FNM_EXTGLOB is optimized [Feature #13873]naruse
The order of resulted array is changed in some cases. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Revert "ignore server side error"naruse
This reverts commit r60314. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21ignore server side errornaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-16spec/ruby/optional/capi/io_spec.rb: speling ficsnormal
* spec/ruby/optional/capi/io_spec.rb: speling: s/writeable/writable/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-29array.c: improve operations on small arraysnobu
[Feature #13884] Reduce number of memory allocations for "and", "or" and "diff" operations on small arrays Very often, arrays are used to filter parameters and to select interesting items from 2 collections and very often these collections are small enough, for example: ```ruby SAFE_COLUMNS = [:id, :title, :created_at] def columns @all_columns & SAFE_COLUMNS end ``` In this patch, I got rid of unnecessary memory allocations for small arrays when "and", "or" and "diff" operations are performed. name | HEAD | PATCH -----------------+------:+------: array_small_and | 0.615 | 0.263 array_small_diff | 0.676 | 0.282 array_small_or | 0.953 | 0.463 name | PATCH -----------------+------: array_small_and | 2.343 array_small_diff | 2.392 array_small_or | 2.056 name | HEAD | PATCH -----------------+------:+------: array_small_and | 1.429 | 1.005 array_small_diff | 1.493 | 0.878 array_small_or | 1.672 | 1.152 name | PATCH -----------------+------: array_small_and | 1.422 array_small_diff | 1.700 array_small_or | 1.452 Author: Dmitry Bochkarev <dimabochkarev@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-28Update to ruby/spec@691755deregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-20check_funcall_missing() should call respond_to_missing?(name, priv=true)eregon
* Improve spec rather than constrain implementation. * Coercion ignores visibility in Ruby. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-20Prefer adapting specs to complicating library codeeregon
* lib/net/ftp.rb (Net::FTP#initialize): simplify as per the original intent. * spec/ruby/library/net/ftp/initialize_spec.rb: adapt specs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-20Move spec/rubyspec to spec/ruby for consistencyeregon
* Other ruby implementations use the spec/ruby directory. [Misc #13792] [ruby-core:82287] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e