summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-07 09:08:17 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-07 09:08:17 +0000
commit34a8bfa971e19985224b42af087778a4c14e0e6e (patch)
treed061fb82edfdf9383212229afb6754ed9b10ee8b
parent251001c8298412def115fc10e0798f283956b5c7 (diff)
* lib/minitest/unit.rb (assert_match): replace matcher only if both
matcher and obj are String. fix r35541. [Bug #6405] DON'T COMMIT IF YOU CAN'T RUN TEST. FIX AS SOON AS POSSIBLE YOU BREAK TESTS. patched by ayumin. https://github.com/seattlerb/minitest/pull/124 * lib/minitest/unit.rb (refute_match): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog11
-rw-r--r--lib/minitest/unit.rb8
2 files changed, 15 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index a1256fc71d..7a42a8f8c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Mon May 7 17:54:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/minitest/unit.rb (assert_match): replace matcher only if both
+ matcher and obj are String. fix r35541. [Bug #6405]
+ DON'T COMMIT IF YOU CAN'T RUN TEST.
+ FIX AS SOON AS POSSIBLE YOU BREAK TESTS.
+ patched by ayumin.
+ https://github.com/seattlerb/minitest/pull/124
+
+ * lib/minitest/unit.rb (refute_match): ditto.
+
Mon May 7 13:41:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in (PROGRAM), configure.in (POSTLINK): sign built program
diff --git a/lib/minitest/unit.rb b/lib/minitest/unit.rb
index 0a0e10816e..707ec5e055 100644
--- a/lib/minitest/unit.rb
+++ b/lib/minitest/unit.rb
@@ -281,8 +281,8 @@ module MiniTest
def assert_match matcher, obj, msg = nil
msg = message(msg) { "Expected #{mu_pp matcher} to match #{mu_pp obj}" }
- assert_respond_to matcher, :"=~"
- matcher = Regexp.new Regexp.escape matcher if String === matcher
+ assert_respond_to obj, :"=~"
+ matcher = Regexp.new Regexp.escape matcher if String === matcher and String === obj
assert matcher =~ obj, msg
end
@@ -582,8 +582,8 @@ module MiniTest
def refute_match matcher, obj, msg = nil
msg = message(msg) {"Expected #{mu_pp matcher} to not match #{mu_pp obj}"}
- assert_respond_to matcher, :"=~"
- matcher = Regexp.new Regexp.escape matcher if String === matcher
+ assert_respond_to obj, :"=~"
+ matcher = Regexp.new Regexp.escape matcher if String === matcher and String === obj
refute matcher =~ obj, msg
end