From 7dea05dc6f5a5c692d226f42f0ca320c68eff894 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 11 Feb 2011 23:03:21 +0000 Subject: [PATCH] * test/ruby/test_settracefunc.rb (TestSetTraceFunc): ensure to use method_added hook defined in Module. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ test/ruby/test_settracefunc.rb | 16 ++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3744b55c92..db6706297b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Feb 12 08:03:12 2011 Nobuyoshi Nakada + + * test/ruby/test_settracefunc.rb (TestSetTraceFunc): ensure to use + method_added hook defined in Module. + Sat Feb 12 01:04:02 2011 Nobuyoshi Nakada * ruby.c (proc_options): enable rubygems if --gem option is given. diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 576b4dad40..4bace9ed61 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -54,9 +54,9 @@ class TestSetTraceFunc < Test::Unit::TestCase events.shift) assert_equal(["line", 4, __method__, self.class], events.shift) - assert_equal(["c-call", 4, :method_added, Module], + assert_equal(["c-call", 4, :method_added, self.class], events.shift) - assert_equal(["c-return", 4, :method_added, Module], + assert_equal(["c-return", 4, :method_added, self.class], events.shift) assert_equal(["line", 7, __method__, self.class], events.shift) @@ -147,9 +147,9 @@ class TestSetTraceFunc < Test::Unit::TestCase events.shift) assert_equal(["line", 4, __method__, self.class], events.shift) - assert_equal(["c-call", 4, :method_added, Module], + assert_equal(["c-call", 4, :method_added, self.class], events.shift) - assert_equal(["c-return", 4, :method_added, Module], + assert_equal(["c-return", 4, :method_added, self.class], events.shift) assert_equal(["line", 8, __method__, self.class], events.shift) @@ -191,9 +191,9 @@ class TestSetTraceFunc < Test::Unit::TestCase events.shift) assert_equal(["line", 4, __method__, self.class], events.shift) - assert_equal(["c-call", 4, :method_added, Module], + assert_equal(["c-call", 4, :method_added, self.class], events.shift) - assert_equal(["c-return", 4, :method_added, Module], + assert_equal(["c-return", 4, :method_added, self.class], events.shift) assert_equal(["line", 8, __method__, self.class], events.shift) @@ -366,4 +366,8 @@ class TestSetTraceFunc < Test::Unit::TestCase set_trace_func(func) assert_equal(self, ok, bug3921) end + + class << self + define_method(:method_added, Module.method(:method_added)) + end end