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

ruby-changes:10766

From: nobu <ko1@a...>
Date: Sun, 15 Feb 2009 21:28:20 +0900 (JST)
Subject: [ruby-changes:10766] Ruby:r22331 (trunk): * lib/test/unit/assertions.rb (Test::Unit::Assertions): aliases

nobu	2009-02-15 21:22:50 +0900 (Sun, 15 Feb 2009)

  New Revision: 22331

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

  Log:
    * lib/test/unit/assertions.rb (Test::Unit::Assertions): aliases
      assert_not_ methods.

  Modified files:
    trunk/ChangeLog
    trunk/lib/test/unit/assertions.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 22330)
+++ ChangeLog	(revision 22331)
@@ -1,3 +1,8 @@
+Sun Feb 15 21:22:48 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/test/unit/assertions.rb (Test::Unit::Assertions): aliases
+	  assert_not_ methods.
+
 Sun Feb 15 16:57:35 2009  Tanaka Akira  <akr@f...>
 
 	* lib/securerandom.rb (SecureRandom.urlsafe_base64): new method.
Index: lib/test/unit/assertions.rb
===================================================================
--- lib/test/unit/assertions.rb	(revision 22330)
+++ lib/test/unit/assertions.rb	(revision 22331)
@@ -122,6 +122,10 @@
         super if !caller[0].rindex(MiniTest::MINI_DIR, 0) || !obj.respond_to?(meth)
       end
 
+      instance_methods(true).grep(/\Arefute_/) do |m|
+        alias_method(('assert_not_' << m.to_s[/.*?_(.*)/, 1]), m)
+      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/

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