aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_delegate.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* delegate.rb: keep special methodsnobu2014-01-171-0/+57
| | | | | | | * lib/delegate.rb (Delegator): keep source information methods which start and end with '__'. [ruby-core:58572] [Bug #9155] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* delegate.rb: ignore unset targetnobu2013-12-041-0/+12
| | | | | | | | | | | * lib/delegate.rb (Delegator#method_missing): ignore the target if not set, and delegate to global methods. [ruby-core:58572] [Bug #9155] * lib/delegate.rb (Delegator#respond_to_missing): ditto. * lib/delegate.rb (SimpleDelegator#__getobj__): yield and return if not delegated but a block is given, like as Hash#fetch. * lib/delegate.rb (DelegateClass#__getobj__): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* delegate.rb: check if target is setnobu2013-11-211-0/+14
| | | | | | | | * lib/delegate.rb (SimpleDelegator#__getobj__): target object must be set. * lib/delegate.rb (DelegateClass#__getobj__): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* delegate.rb: refix r43682nobu2013-11-191-0/+9
| | | | | | | * lib/delegate.rb (Delegator#send): separate from method_missing so that super calls proper method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* delegate.rb: get rid of global function interferencenobu2013-11-151-0/+12
| | | | | | | * lib/delegate.rb (Delegator#send): override to get rid of global function interference. [Fixes GH-449] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/delegate.rb (Delegator#methods): Kernel#methods receivesnaruse2011-12-041-0/+7
| | | | | | zero or one argument. [ruby-core:37118] [Bug #4882] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_clone): call initialize_clone hook method tomatz2010-02-081-0/+3
| | | | | | | | | | | | | | | | call initialize_copy. * object.c (rb_obj_dup): call initialize_dup hook. * lib/delegate.rb (Delegator#initialize_clone): use new hook to implement deep copy. [ruby-dev:40242] * lib/delegate.rb (Delegator#initialize_dup): ditto. * test/test_delegate.rb (TestDelegateClass#test_copy_frozen): add a test to ensure #clone copies frozen status. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/test_delegate.rb (TestDelegateClass::IV#initialize): shouldnobu2010-02-061-0/+2
| | | | | | | | | | set delegation target. * test/test_delegate.rb (TestDelegateClass#test_copy_frozen): clone of frozen delegator also should be frozen. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/delegate.rb (Delegator): include copy of Kernel.nobu2010-02-051-6/+42
| | | | | | | | | | [ruby-dev:40314] * lib/delegate.rb (Delegator#{dup,clone}): class of copy should be Delegator. [ruby-dev:40313] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/delegate.rb (Delegator): now inherits BasicObject.nobu2010-02-031-0/+18
| | | | | | | [ruby-dev:39154], [Bug #2679], [ruby-dev:40242] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (w_object): reverted r26007. [ruby-dev:39845]nobu2009-12-071-0/+16
| | | | | | | * test/test_delegate.rb (test_marshal): moved from test_marshal.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/delegate.rb (Delegator::public_api): take snapshot ofmatz2009-10-061-0/+22
| | | | | | | | | | | | public method at the beginning time. * lib/delegate.rb (SimpleDelegator#initialize): use Delegator.public_api since public_method might be added after initialization. [ruby-dev:39383] * lib/delegate.rb (DelegateClass): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add test for {SimpleDelegator, DelegateClass}#class .xibbar2008-10-181-0/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add a test for [ruby-dev:34808].akr2008-05-241-0/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/test_delegate.rb: add new test file for delegate.rb.usa2008-01-161-0/+15
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e