[前][次][番号順一覧][スレッド一覧]

ruby-changes:44457

From: shyouhei <ko1@a...>
Date: Mon, 31 Oct 2016 17:43:59 +0900 (JST)
Subject: [ruby-changes:44457] shyouhei:r56530 (trunk): * test/test_forwardable.rb (TestForwardable#test_on_private_method): add test for [Bug #12782] [Bug #12840]

shyouhei	2016-10-31 17:43:54 +0900 (Mon, 31 Oct 2016)

  New Revision: 56530

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56530

  Log:
    * test/test_forwardable.rb (TestForwardable#test_on_private_method): add test for [Bug #12782] [Bug #12840]

  Modified files:
    trunk/ChangeLog
    trunk/test/test_forwardable.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 56529)
+++ ChangeLog	(revision 56530)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Oct 31 17:36:04 2016  Code Ahss  <aycabta@g...>
+
+	* test/test_forwardable.rb (TestForwardable#test_on_private_method):
+	  add test for [Bug #12782] [Bug #12840]
+
 Mon Oct 31 11:08:51 2016  Samuel Williams  <samuel.williams@o...>
 
 	* lib/uri/generic.rb (URI::Generic#merge): merge merge0.
Index: test/test_forwardable.rb
===================================================================
--- test/test_forwardable.rb	(revision 56529)
+++ test/test_forwardable.rb	(revision 56530)
@@ -285,6 +285,17 @@ class TestForwardable < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/test_forwardable.rb#L285
     assert_equal(42, -obj)
   end
 
+  def test_on_private_method
+    cls = Class.new do
+      private def foo; :foo end
+      extend Forwardable
+      def_delegator :itself, :foo, :bar
+    end
+    assert_warn(/forwarding to private method/) do
+      assert_equal(:foo, cls.new.bar)
+    end
+  end
+
   private
 
   def forwardable_class(

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]