summaryrefslogtreecommitdiffstats
path: root/lib/test/unit/assertions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/test/unit/assertions.rb')
-rw-r--r--lib/test/unit/assertions.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb
index 0af3468b9..b0df0ea2d 100644
--- a/lib/test/unit/assertions.rb
+++ b/lib/test/unit/assertions.rb
@@ -1,7 +1,7 @@
# :nodoc:
#
# Author:: Nathaniel Talbott.
-# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved.
# License:: Ruby license.
require 'test/unit/assertionfailederror'
@@ -138,6 +138,12 @@ module Test # :nodoc:
"<#{arg1}> expected to be =~\n" +
"<#{arg2}>"
end
+ pattern = case(pattern)
+ when String
+ Regexp.new(pattern)
+ else
+ pattern
+ end
assert_block(full_message) { string =~ pattern }
end
end