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

ruby-changes:32431

From: nobu <ko1@a...>
Date: Mon, 6 Jan 2014 23:34:25 +0900 (JST)
Subject: [ruby-changes:32431] nobu:r44510 (trunk): test_super.rb: test_module_super_in_method_module

nobu	2014-01-06 23:34:18 +0900 (Mon, 06 Jan 2014)

  New Revision: 44510

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44510

  Log:
    test_super.rb: test_module_super_in_method_module
    
    * test/ruby/test_super.rb (test_module_super_in_method_module): more
      test for the case searching super method from a method defined in a
      module.  [ruby-core:59589] [Bug #9315]

  Modified files:
    trunk/test/ruby/test_super.rb
Index: test/ruby/test_super.rb
===================================================================
--- test/ruby/test_super.rb	(revision 44509)
+++ test/ruby/test_super.rb	(revision 44510)
@@ -422,4 +422,22 @@ class TestSuper < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_super.rb#L422
       b.new.method(:foo).call
     end
   end
+
+  def test_module_super_in_method_module
+    bug9315 = '[ruby-core:59589] [Bug #9315]'
+    a = Module.new do
+      def foo
+        super
+      end
+    end
+    c = Class.new do
+      def foo
+        :ok
+      end
+    end
+    o = c.new.extend(a)
+    assert_nothing_raised(NoMethodError, bug9315) do
+      assert_equal(:ok, o.method(:foo).call, bug9315)
+    end
+  end
 end

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

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