summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-15 12:22:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-15 12:22:50 +0000
commit8fc45476ebf80e8da9c50ff441e623c1550799e6 (patch)
tree71d6b3da1f56eb31ee807f7b36abaea54247c017
parent1f125adde0e6cad77b13c521cb95c7089885b398 (diff)
* lib/test/unit/assertions.rb (Test::Unit::Assertions): aliases
assert_not_ methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/test/unit/assertions.rb4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 7104682..411c50b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Feb 15 21:22:48 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit/assertions.rb (Test::Unit::Assertions): aliases
+ assert_not_ methods.
+
Sun Feb 15 16:57:35 2009 Tanaka Akira <akr@fsij.org>
* lib/securerandom.rb (SecureRandom.urlsafe_base64): new method.
diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb
index 2e9fadf..de357d0 100644
--- a/lib/test/unit/assertions.rb
+++ b/lib/test/unit/assertions.rb
@@ -122,6 +122,10 @@ EOT
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) }