summaryrefslogtreecommitdiff
path: root/lib/minitest
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-07 17:49:53 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-07 17:49:53 +0000
commit49331ddec794834987ec5e7c4aa51264345a8ca0 (patch)
tree7461bd28dd0b520e485e6e4806eca099dd676ccc /lib/minitest
parent40f1939614fe43244486fb9086e68dbf2135a506 (diff)
* lib/minitest/unit.rb (assert_match): refix of r35563.
r35563 breaks the intention of the original change. https://github.com/seattlerb/minitest/commit/68858105b2eb11c85105ffac5f32b662c59397f3 * lib/minitest/unit.rb (refute_match): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/minitest')
-rw-r--r--lib/minitest/unit.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/minitest/unit.rb b/lib/minitest/unit.rb
index 707ec5e055..9d9439c552 100644
--- a/lib/minitest/unit.rb
+++ b/lib/minitest/unit.rb
@@ -282,7 +282,7 @@ module MiniTest
def assert_match matcher, obj, msg = nil
msg = message(msg) { "Expected #{mu_pp matcher} to match #{mu_pp obj}" }
assert_respond_to obj, :"=~"
- matcher = Regexp.new Regexp.escape matcher if String === matcher and String === obj
+ matcher = Regexp.new Regexp.escape matcher if String === matcher and obj.respond_to?(:to_str)
assert matcher =~ obj, msg
end
@@ -583,7 +583,7 @@ 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 obj, :"=~"
- matcher = Regexp.new Regexp.escape matcher if String === matcher and String === obj
+ matcher = Regexp.new Regexp.escape matcher if String === matcher and obj.respond_to?(:to_str)
refute matcher =~ obj, msg
end