summaryrefslogtreecommitdiff
path: root/test/ruby/test_object.rb
AgeCommit message (Collapse)Author
2013-12-24assertions.rb: assert_thrownobu
* lib/test/unit/assertions.rb (assert_throw): make an alias of assert_throws. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13test/ruby: better assertionsnobu
* test/ruby: use better assertions instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-09test/unit/assertions.rb: return exceptionnobu
* lib/test/unit/assertions.rb (assert_raise_with_message): return raised exception same as assert_raise. * test/ruby, test/-ext-: use assert_raise_with_message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-20parse.y: junk sigil only namesnobu
* parse.y (intern_str): sigil only names are junk, at least one identifier character is needed. [ruby-dev:47723] [Bug #8928] * parse.y (rb_enc_symname_type): fix out of bound access. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-13* test/-ext-/test_printf.rb, test/rss/test_parser.rb,shugo
test/ruby/test_array.rb, test/ruby/test_hash.rb, test/ruby/test_m17n.rb, test/ruby/test_marshal.rb, test/ruby/test_object.rb, test/ruby/test_string.rb: don't use untrusted?, untrust, and trust to avoid warnings in case $VERBOSE is true. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo
when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-08* object.c (rb_obj_ivar_set): call to_str for string only once.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-04object.c: avoid inadvertent symbol creationnobu
* object.c (rb_mod_cvar_set): fix typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-15r39766 denied to initialized already initialized time objectnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-13class.c: from the origin classnobu
* class.c (rb_obj_singleton_methods): collect methods from the origin class. [ruby-core:53207] [Bug #8044] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-29* object.c: Improve error for failed implicit conversions [Bug #7539]marcandre
* error.c: Adapt rdoc * test/ruby/test_object.rb: Test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-05vm_eval.c: public_send does not consider how it is callednobu
* vm_eval.c (rb_method_call_status): use Qundef as no self instead of the current self. * vm_eval.c (send_internal): public_send does not consider how it is called, as mentioned in r14173. patched by charliesome (Charlie Somerville). [ruby-core:50489] [Bug #7499] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-05test_object.rb: test for public_sendnobu
* test/ruby/test_object.rb (TestObject#test_public_send): add test for public_send. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01object.c: make remove_instance_variable publicnobu
* object.c (Init_Object): make remove_instance_variable public. [Feature #6539] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28* bignum.c (bignew_1): Bignum instances are frozen.ko1
Feature #3222 * include/ruby/ruby.h: Fixnum instances are also frozen. * class.c (singleton_class_of): check Bignum before singleton cheking. * test/ruby/test_bignum.rb: add a test. * test/ruby/test_fixnum.rb: ditto. * test/ruby/marshaltestlib.rb, test/ruby/test_eval.rb, test/ruby/test_object.rb: catch up above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-05Adding a test for initialize_clone and initialize_dup. From Github:tenderlove
https://github.com/ruby/ruby/pull/190 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-17object.c: preserve encodingsnobu
* object.c (rb_any_to_s, rb_obj_inspect): preserve encodings of class name and instance variable names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-15Kernel#inspect: improve consistency and do not call #to_s.eregon
* object.c (rb_obj_inspect): Kernel#inspect: do not call #to_s. A class can now benefit from the nice default #inspect even if it defines #to_s. Also, there is no more unexpected change in #inspect result. * NEWS: Add note about the change. * bignum.c, io.c, numeric.c, object.c, proc.c, vm.c (Init_*): Adapt internal structures (by aliasing #inspect to #to_s) so they don't rely on the removed behavior (#inspect calling overridden #to_s). * test/ruby/test_object.rb (test_inspect): add tests for Kernel#inspect. * lib/pp.rb (class PP): do not call #to_s anymore, as #inspect no more does (mame). * test/test_pp.rb (class PPInspectTest): remove related assertion (mame). [ruby-core:43238][Feature #6130] * test/drb/drbtest.rb (DRbCore#teardown, DRbAry#teardown): adapt DRb tests with the new change (shirosaki). [ruby-core:47182][Bug #6866] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-15Revert r36699 and r36700. [Feature #6130]naruse
Revert "Kernel#inspect: improve consistency and do not call #to_s." Revert "update PP with recent Kernel#inspect change. Patch by Yusuke Endoh." r36699 cause test-all failure on test/drb/test_drb.rb and test/drb/test_drbssl.rb. Run test-all before commit. Moreover its ChangeLog formst is wrong: see CommitterHowto https://bugs.ruby-lang.org/projects/ruby/wiki/CommitterHowto#ChangeLog git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-14Kernel#inspect: improve consistency and do not call #to_s.eregon
A class can now benefit from the nice default #inspect even if it defines #to_s. Also, there is no more unexpected change in #inspect result. Internal structures have been adapted so they don't rely on the removed behavior (#inspect calling overridden #to_s). * object.c (rb_obj_inspect): Kernel#inspect: do not call #to_s. * test/ruby/test_object.rb (test_inspect): add tests for Kernel#inspect. * bignum.c, io.c, numeric.c, object.c, proc.c, vm.c (Init_*): alias #inspect to #to_s where it was expected. [ruby-core:43238][Feature #6130] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-05obj_init_copynobu
* object.c (rb_obj_init_copy): should check if trusted too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* test/ruby/test_arity.rb (TestArity#err_mess): use assert_raise.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14 * vm_eval.c (check_funcall): Raise ArgumentError if respond_to?drbrain
requires more than three arguments. [Bug #6000] * test/ruby/test_object.rb (class TestObject): Test for respond_to? requiring more than three arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-12* vm_method.c (Init_eval_method): copy basic methods to Exception.nobu
[ruby-core:40287][Bug #5473] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-11* vm_eval.c (check_funcall): Call respond_to? with matching arity fordrbrain
legacy single-argument implementations. [ruby-trunk - Bug #6000] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-30* vm_eval.c (vm_call0): should pass block to enumerators. patchednobu
by Kazuki Tsujimoto. [ruby-dev:44961][Bug #5731] * vm_eval.c (method_missing), vm_insnhelper.c (vm_call_method): ditto. patched by satoshi shiba. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-24* object.c (rb_Hash): trivial optimization.nobu
* test/ruby/test_object.rb (TestObject#test_convert_hash): fix arguments order. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-24* object.c (rb_Hash): add Kernel#Hash conversion method likematz
Array() or Float(). a patch from Run Paint Run Run. Fix #3131 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-02* test/ruby/test_object.rb (test_send_with_block): add a normal case.ktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-02* test/ruby/test_object.rb (test_send_with_block): moved fromktsj
bootstraptest/test_flow.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-05* test/ruby/test_object.rb: tests that respond_to? returns false.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-05* vm_eval.c (check_funcall): try respond_to? first if redefined.nobu
[Bug #5158] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26* vm_method.c (obj_respond_to): fix the respond_to_missing? overridenobu
case. based on the patch by Jeremy Evans at [ruby-core:38417]. [Feature #5072] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-22* test/ruby/test_object.rb (TestObject#test_respond_to_missing):kazu
2nd argument of respond_to_missing? is not optional. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-23* object.c (rb_obj_singleton_class): new methodshugo
Kernel#singleton_class. [ruby-core:21702] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-19* vm_eval.c (check_funcall): reset method_missing_reason beforenobu
trying the call. based on a patch from Yehuda Katz in [ruby-core:27219]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-13* test/ruby/envutil.rb (invoke_ruby): call to_str for stdin_data toakr
reject non-string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-03* compile.c (compile_cpath, iseq_compile_each): revertedshugo
constant/class variable lookup in instance_eval etc. to the behavior of 1.8. * eval.c (rb_mod_nesting): ditto. * insns.def (putspecialobject, defineclass): ditto. * node.h (NODE_FL_CREF_PUSHED_BY_EVAL): ditto. * vm_core.h (VM_SPECIAL_OBJECT_CONST_BASE): ditto. * vm_eval.c (yield_under, eval_under): ditto. * vm_insnhelper.c (vm_cref_push, vm_get_const_base, vm_get_ev_const, vm_get_cvar_base): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-30* vm_eval.c (vm_call0, vm_call_super, rb_f_send, rb_f_public_send):nobu
fixed call_type. [ruby-dev:39581] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-16* test/ruby/test_object.rb (test_respond_to_missing):nobu
respond_to_missing? should accept two arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-16* test/ruby/test_object.rb (test_remove_method): test for Bug#2202.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-28git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25129 ↵matz
b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-25* proc.c (missing_wrap): reverted.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-25* proc.c (mnew): fix for instance method of Module, BasicObjectnobu
and subclass of a class which overrides respond_to_missing?. based on a patch from Nikolai Lugovoi <nlugovoi AT gmail.com> in [ruby-core:25748]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-24* proc.c (mnew): generate method object that wraps method_missing,matz
when #respond_to_missing? is defined. * test/ruby/test_object.rb (test_respond_to_missing): add test suites for #respond_to_missing? changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-04* lib/pp.rb (guard_inspect_key): untrust internal hash to preventmame
unexpected SecurityError. * test/ruby/test_object.rb: add a test for [ruby-dev:38982]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-06* test/ruby/test_module.rb (TestModule#test_undef): adjust tomatz
message change. * test/ruby/test_object.rb (TestObject#test_redefine_method_which_may_case_serious_problem): ditto. * test/ruby/test_object.rb (TestObject#test_remove_method): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-08* test/ruby/test_object.rb: add a test for Object#method_missing.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-09* test/ruby/test_module.rb (test_remove_class_variable): add a testmame
for Class#remove_class_variable. * test/ruby/test_object.rb (test_remove_instance_variable): add a test for Object#remove_instance_variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13* object.c (rb_obj_untrusted): new method Object#untrusted?.shugo
(rb_obj_untrust): new method Object#untrust. (rb_obj_trust): new method Object#trust. * array.c, debug.c, time.c, include/ruby/ruby.h, re.c, variable.c, string.c, io.c, dir.c, vm_method.c, struct.c, class.c, hash.c, ruby.c, marshal.c: fixes for Object#untrusted?. * test/ruby/test_module.rb, test/ruby/test_array.rb, test/ruby/test_object.rb, test/ruby/test_string.rb, test/ruby/test_marshal.rb, test/ruby/test_hash.rb: added tests for Object#untrusted?. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e