ruby-changes:10343
From: nobu <ko1@a...>
Date: Fri, 30 Jan 2009 11:03:58 +0900 (JST)
Subject: [ruby-changes:10343] Ruby:r21887 (trunk): * lib/test/unit/assertions.rb (assert_respond_to): gets rid of
nobu 2009-01-30 11:03:32 +0900 (Fri, 30 Jan 2009) New Revision: 21887 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21887 Log: * lib/test/unit/assertions.rb (assert_respond_to): gets rid of overcounting. [ruby-dev:37703] Modified files: trunk/ChangeLog trunk/lib/test/unit/assertions.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 21886) +++ ChangeLog (revision 21887) @@ -1,3 +1,8 @@ +Fri Jan 30 11:03:31 2009 Nobuyoshi Nakada <nobu@r...> + + * lib/test/unit/assertions.rb (assert_respond_to): gets rid of + overcounting. [ruby-dev:37703] + Fri Jan 30 02:55:56 2009 Tanaka Akira <akr@f...> * transcode.c (rb_econv_init_by_convpath_i): make it static. Index: lib/test/unit/assertions.rb =================================================================== --- lib/test/unit/assertions.rb (revision 21886) +++ lib/test/unit/assertions.rb (revision 21887) @@ -113,6 +113,11 @@ assert(!actual.equal?(expected), msg) end + # get rid of overcounting + def assert_respond_to obj, meth, msg = nil + super if !caller[0].rindex(MiniTest::MINI_DIR, 0) || !obj.respond_to?(meth) + end + def build_message(head, template=nil, *arguments) template &&= template.chomp template.gsub(/\?/) { mu_pp(arguments.shift) } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/